<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:yui="http://yuilibrary.com/rdf/1.0/yui.rdf#">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	<title>API: yuiloader   yuiloader.js  (YUI Library)</title>

	<link rel="stylesheet" type="text/css" href="assets/reset-fonts-grids-min.css" />
	<link rel="stylesheet" type="text/css" href="assets/api.css" />

    <script type="text/javascript" src="assets/api-js"></script>
    <script type="text/javascript" src="assets/ac-js"></script>
</head>

<body id="yahoo-com">

<div id="doc3" class="yui-t2">
	<div id="hd">
        <h1><a href="http://developer.yahoo.com/yui/" title="Yahoo! UI Library">Yahoo! UI Library</a></h1>
        <h3>yuiloader&nbsp; <span class="subtitle">2.9.0</span></h3>
        <a href="./index.html" title="Yahoo! UI Library">Yahoo! UI Library</a> 
            &gt; <a href="./module_yuiloader.html" title="yuiloader">yuiloader</a>
                
                 &gt; yuiloader.js (source view) 
        <form onsubmit="return false">
            <div id="propertysearch">
                Search: <input autocomplete="off" id="searchinput" />
                <div id="searchresults">
                    &nbsp;
                </div>
            </div>
        </form>
	</div>

	<div id="bd">
		<div id="yui-main">
			<div class="yui-b">
            <form action="#" name="yui-classopts-form" method="get" id="yui-classopts-form">
                <fieldset>
                    <legend>Filters</legend>
                <span class="classopts"><input type="checkbox" name="show_private" id="show_private" /> <label for="show_private">Show Private</label></span>
                <span class="classopts"><input type="checkbox" name="show_protected" id="show_protected" /> <label for="show_protected">Show Protected</label></span>
                <span class="classopts"><input type="checkbox" name="show_deprecated" id="show_deprecated" /> <label for="show_deprecated">Show Deprecated</label></span>
                </fieldset>
            </form>

                    <div id="srcout">
                        <style>
                            #doc3 .classopts { display:none; }
                        </style>
                        <div class="highlight"><pre><span class="cm">/*jslint evil: true, strict: false, regexp: false*/</span>

<span class="cm">/**</span>
<span class="cm"> * Provides dynamic loading for the YUI library.  It includes the dependency</span>
<span class="cm"> * info for the library, and will automatically pull in dependencies for</span>
<span class="cm"> * the modules requested.  It supports rollup files (such as utilities.js</span>
<span class="cm"> * and yahoo-dom-event.js), and will automatically use these when</span>
<span class="cm"> * appropriate in order to minimize the number of http connections</span>
<span class="cm"> * required to load all of the dependencies.</span>
<span class="cm"> *</span>
<span class="cm"> * @module yuiloader</span>
<span class="cm"> * @namespace YAHOO.util</span>
<span class="cm"> */</span>

<span class="cm">/**</span>
<span class="cm"> * YUILoader provides dynamic loading for YUI.</span>
<span class="cm"> * @class YAHOO.util.YUILoader</span>
<span class="cm"> * @todo</span>
<span class="cm"> *      version management, automatic sandboxing</span>
<span class="cm"> */</span>
<span class="p">(</span><span class="kd">function</span><span class="p">()</span> <span class="p">{</span>

    <span class="kd">var</span> <span class="nx">Y</span> <span class="o">=</span> <span class="nx">YAHOO</span><span class="p">,</span>
        <span class="nx">util</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">util</span><span class="p">,</span>
        <span class="nx">lang</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">lang</span><span class="p">,</span>
        <span class="nx">env</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">env</span><span class="p">,</span>
        <span class="nx">PROV</span> <span class="o">=</span> <span class="s2">&quot;_provides&quot;</span><span class="p">,</span>
        <span class="nx">SUPER</span> <span class="o">=</span> <span class="s2">&quot;_supersedes&quot;</span><span class="p">,</span>
        <span class="nx">REQ</span> <span class="o">=</span> <span class="s2">&quot;expanded&quot;</span><span class="p">,</span>
        <span class="nx">AFTER</span> <span class="o">=</span> <span class="s2">&quot;_after&quot;</span><span class="p">,</span>
        <span class="nx">VERSION</span> <span class="o">=</span> <span class="s2">&quot;@VERSION@&quot;</span><span class="p">;</span>

    <span class="c1">// version hack for cdn testing</span>
    <span class="c1">// if (/VERSION/.test(VERSION)) {</span>
        <span class="c1">// VERSION = &quot;2.8.2&quot;;</span>
    <span class="c1">// }</span>

    <span class="kd">var</span> <span class="nx">YUI</span> <span class="o">=</span> <span class="p">{</span>

        <span class="nx">dupsAllowed</span><span class="o">:</span> <span class="p">{</span><span class="s1">&#39;yahoo&#39;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span> <span class="s1">&#39;get&#39;</span><span class="o">:</span> <span class="kc">true</span><span class="p">},</span>

        <span class="cm">/*</span>
<span class="cm">         * The library metadata for the current release  The is the default</span>
<span class="cm">         * value for YAHOO.util.YUILoader.moduleInfo</span>
<span class="cm">         * @property YUIInfo</span>
<span class="cm">         * @static</span>
<span class="cm">         */</span>
        <span class="nx">info</span><span class="o">:</span> <span class="p">{</span>

    <span class="c1">// &#39;root&#39;: &#39;2.5.2/build/&#39;,</span>
    <span class="c1">// &#39;base&#39;: &#39;http://yui.yahooapis.com/2.5.2/build/&#39;,</span>

    <span class="s1">&#39;root&#39;</span><span class="o">:</span> <span class="nx">VERSION</span> <span class="o">+</span> <span class="s1">&#39;/build/&#39;</span><span class="p">,</span>
    <span class="s1">&#39;base&#39;</span><span class="o">:</span> <span class="s1">&#39;http://yui.yahooapis.com/&#39;</span> <span class="o">+</span> <span class="nx">VERSION</span> <span class="o">+</span> <span class="s1">&#39;/build/&#39;</span><span class="p">,</span>

    <span class="s1">&#39;comboBase&#39;</span><span class="o">:</span> <span class="s1">&#39;http://yui.yahooapis.com/combo?&#39;</span><span class="p">,</span>

    <span class="s1">&#39;skin&#39;</span><span class="o">:</span> <span class="p">{</span>
        <span class="s1">&#39;defaultSkin&#39;</span><span class="o">:</span> <span class="s1">&#39;sam&#39;</span><span class="p">,</span>
        <span class="s1">&#39;base&#39;</span><span class="o">:</span> <span class="s1">&#39;assets/skins/&#39;</span><span class="p">,</span>
        <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;skin.css&#39;</span><span class="p">,</span>
        <span class="s1">&#39;after&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;reset&#39;</span><span class="p">,</span> <span class="s1">&#39;fonts&#39;</span><span class="p">,</span> <span class="s1">&#39;grids&#39;</span><span class="p">,</span> <span class="s1">&#39;base&#39;</span><span class="p">],</span>
        <span class="s1">&#39;rollup&#39;</span><span class="o">:</span> <span class="mi">3</span>
    <span class="p">},</span>

    <span class="nx">dupsAllowed</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">,</span> <span class="s1">&#39;get&#39;</span><span class="p">],</span>

    <span class="s1">&#39;moduleInfo&#39;</span><span class="o">:</span> <span class="p">{</span>

        <span class="s1">&#39;animation&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;animation/animation-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dom&#39;</span><span class="p">,</span> <span class="s1">&#39;event&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;autocomplete&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;autocomplete/autocomplete-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dom&#39;</span><span class="p">,</span> <span class="s1">&#39;event&#39;</span><span class="p">,</span> <span class="s1">&#39;datasource&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;connection&#39;</span><span class="p">,</span> <span class="s1">&#39;animation&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;base&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;css&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;base/base-min.css&#39;</span><span class="p">,</span>
            <span class="s1">&#39;after&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;reset&#39;</span><span class="p">,</span> <span class="s1">&#39;fonts&#39;</span><span class="p">,</span> <span class="s1">&#39;grids&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;button&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;button/button-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;menu&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;calendar&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;calendar/calendar-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event&#39;</span><span class="p">,</span> <span class="s1">&#39;dom&#39;</span><span class="p">],</span>
            <span class="nx">supersedes</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;datemath&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;carousel&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;carousel/carousel-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;animation&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;charts&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;charts/charts-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">,</span> <span class="s1">&#39;json&#39;</span><span class="p">,</span> <span class="s1">&#39;datasource&#39;</span><span class="p">,</span> <span class="s1">&#39;swf&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;colorpicker&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;colorpicker/colorpicker-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;slider&#39;</span><span class="p">,</span> <span class="s1">&#39;element&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;animation&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;connection&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;connection/connection-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event&#39;</span><span class="p">],</span>
            <span class="s1">&#39;supersedes&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;connectioncore&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;connectioncore&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;connection/connection_core-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event&#39;</span><span class="p">],</span>
            <span class="s1">&#39;pkg&#39;</span><span class="o">:</span> <span class="s1">&#39;connection&#39;</span>
        <span class="p">},</span>

        <span class="s1">&#39;container&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;container/container-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dom&#39;</span><span class="p">,</span> <span class="s1">&#39;event&#39;</span><span class="p">],</span>
            <span class="c1">// button is also optional, but this creates a circular</span>
            <span class="c1">// dependency when loadOptional is specified.  button</span>
            <span class="c1">// optionally includes menu, menu requires container.</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dragdrop&#39;</span><span class="p">,</span> <span class="s1">&#39;animation&#39;</span><span class="p">,</span> <span class="s1">&#39;connection&#39;</span><span class="p">],</span>
            <span class="s1">&#39;supersedes&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;containercore&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;containercore&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;container/container_core-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dom&#39;</span><span class="p">,</span> <span class="s1">&#39;event&#39;</span><span class="p">],</span>
            <span class="s1">&#39;pkg&#39;</span><span class="o">:</span> <span class="s1">&#39;container&#39;</span>
        <span class="p">},</span>

        <span class="s1">&#39;cookie&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;cookie/cookie-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;datasource&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;datasource/datasource-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;connection&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;datatable&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;datatable/datatable-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">,</span> <span class="s1">&#39;datasource&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;calendar&#39;</span><span class="p">,</span> <span class="s1">&#39;dragdrop&#39;</span><span class="p">,</span> <span class="s1">&#39;paginator&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="nx">datemath</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;datemath/datemath-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;dom&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;dom/dom-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;dragdrop&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;dragdrop/dragdrop-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dom&#39;</span><span class="p">,</span> <span class="s1">&#39;event&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;editor&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;editor/editor-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;menu&#39;</span><span class="p">,</span> <span class="s1">&#39;element&#39;</span><span class="p">,</span> <span class="s1">&#39;button&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;animation&#39;</span><span class="p">,</span> <span class="s1">&#39;dragdrop&#39;</span><span class="p">],</span>
            <span class="s1">&#39;supersedes&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;simpleeditor&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;element&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;element/element-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dom&#39;</span><span class="p">,</span> <span class="s1">&#39;event&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event-mouseenter&#39;</span><span class="p">,</span> <span class="s1">&#39;event-delegate&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;element-delegate&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;element-delegate/element-delegate-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;event&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;event/event-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;event-simulate&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;event-simulate/event-simulate-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;event-delegate&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;event-delegate/event-delegate-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;selector&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;event-mouseenter&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;event-mouseenter/event-mouseenter-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dom&#39;</span><span class="p">,</span> <span class="s1">&#39;event&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;fonts&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;css&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;fonts/fonts-min.css&#39;</span>
        <span class="p">},</span>

        <span class="s1">&#39;get&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;get/get-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;grids&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;css&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;grids/grids-min.css&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;fonts&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;reset&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;history&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;history/history-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event&#39;</span><span class="p">]</span>
        <span class="p">},</span>

         <span class="s1">&#39;imagecropper&#39;</span><span class="o">:</span> <span class="p">{</span>
             <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
             <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;imagecropper/imagecropper-min.js&#39;</span><span class="p">,</span>
             <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dragdrop&#39;</span><span class="p">,</span> <span class="s1">&#39;element&#39;</span><span class="p">,</span> <span class="s1">&#39;resize&#39;</span><span class="p">],</span>
             <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
         <span class="p">},</span>

         <span class="s1">&#39;imageloader&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;imageloader/imageloader-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event&#39;</span><span class="p">,</span> <span class="s1">&#39;dom&#39;</span><span class="p">]</span>
         <span class="p">},</span>

         <span class="s1">&#39;json&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;json/json-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">]</span>
         <span class="p">},</span>

         <span class="s1">&#39;layout&#39;</span><span class="o">:</span> <span class="p">{</span>
             <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
             <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;layout/layout-min.js&#39;</span><span class="p">,</span>
             <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">],</span>
             <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;animation&#39;</span><span class="p">,</span> <span class="s1">&#39;dragdrop&#39;</span><span class="p">,</span> <span class="s1">&#39;resize&#39;</span><span class="p">,</span> <span class="s1">&#39;selector&#39;</span><span class="p">],</span>
             <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
         <span class="p">},</span>

        <span class="s1">&#39;logger&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;logger/logger-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event&#39;</span><span class="p">,</span> <span class="s1">&#39;dom&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dragdrop&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;menu&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;menu/menu-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;containercore&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;paginator&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;paginator/paginator-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;profiler&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;profiler/profiler-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">]</span>
        <span class="p">},</span>


        <span class="s1">&#39;profilerviewer&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;profilerviewer/profilerviewer-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;profiler&#39;</span><span class="p">,</span> <span class="s1">&#39;yuiloader&#39;</span><span class="p">,</span> <span class="s1">&#39;element&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;progressbar&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;progressbar/progressbar-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;animation&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;reset&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;css&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;reset/reset-min.css&#39;</span>
        <span class="p">},</span>

        <span class="s1">&#39;reset-fonts-grids&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;css&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;reset-fonts-grids/reset-fonts-grids.css&#39;</span><span class="p">,</span>
            <span class="s1">&#39;supersedes&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;reset&#39;</span><span class="p">,</span> <span class="s1">&#39;fonts&#39;</span><span class="p">,</span> <span class="s1">&#39;grids&#39;</span><span class="p">,</span> <span class="s1">&#39;reset-fonts&#39;</span><span class="p">],</span>
            <span class="s1">&#39;rollup&#39;</span><span class="o">:</span> <span class="mi">4</span>
        <span class="p">},</span>

        <span class="s1">&#39;reset-fonts&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;css&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;reset-fonts/reset-fonts.css&#39;</span><span class="p">,</span>
            <span class="s1">&#39;supersedes&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;reset&#39;</span><span class="p">,</span> <span class="s1">&#39;fonts&#39;</span><span class="p">],</span>
            <span class="s1">&#39;rollup&#39;</span><span class="o">:</span> <span class="mi">2</span>
        <span class="p">},</span>

         <span class="s1">&#39;resize&#39;</span><span class="o">:</span> <span class="p">{</span>
             <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
             <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;resize/resize-min.js&#39;</span><span class="p">,</span>
             <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dragdrop&#39;</span><span class="p">,</span> <span class="s1">&#39;element&#39;</span><span class="p">],</span>
             <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;animation&#39;</span><span class="p">],</span>
             <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
         <span class="p">},</span>

        <span class="s1">&#39;selector&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;selector/selector-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">,</span> <span class="s1">&#39;dom&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;simpleeditor&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;editor/simpleeditor-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;containercore&#39;</span><span class="p">,</span> <span class="s1">&#39;menu&#39;</span><span class="p">,</span> <span class="s1">&#39;button&#39;</span><span class="p">,</span> <span class="s1">&#39;animation&#39;</span><span class="p">,</span> <span class="s1">&#39;dragdrop&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
            <span class="s1">&#39;pkg&#39;</span><span class="o">:</span> <span class="s1">&#39;editor&#39;</span>
        <span class="p">},</span>

        <span class="s1">&#39;slider&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;slider/slider-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;dragdrop&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;animation&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;storage&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;storage/storage-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">,</span> <span class="s1">&#39;event&#39;</span><span class="p">,</span> <span class="s1">&#39;cookie&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;swfstore&#39;</span><span class="p">]</span>
        <span class="p">},</span>

         <span class="s1">&#39;stylesheet&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;stylesheet/stylesheet-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">]</span>
         <span class="p">},</span>

        <span class="s1">&#39;swf&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;swf/swf-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">],</span>
            <span class="s1">&#39;supersedes&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;swfdetect&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;swfdetect&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;swfdetect/swfdetect-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;swfstore&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;swfstore/swfstore-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">,</span> <span class="s1">&#39;cookie&#39;</span><span class="p">,</span> <span class="s1">&#39;swf&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;tabview&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;tabview/tabview-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;connection&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;treeview&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;treeview/treeview-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event&#39;</span><span class="p">,</span> <span class="s1">&#39;dom&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;json&#39;</span><span class="p">,</span> <span class="s1">&#39;animation&#39;</span><span class="p">,</span> <span class="s1">&#39;calendar&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">},</span>

        <span class="s1">&#39;uploader&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;uploader/uploader-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;element&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;utilities&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;utilities/utilities.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;supersedes&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">,</span> <span class="s1">&#39;event&#39;</span><span class="p">,</span> <span class="s1">&#39;dragdrop&#39;</span><span class="p">,</span> <span class="s1">&#39;animation&#39;</span><span class="p">,</span> <span class="s1">&#39;dom&#39;</span><span class="p">,</span> <span class="s1">&#39;connection&#39;</span><span class="p">,</span> <span class="s1">&#39;element&#39;</span><span class="p">,</span> <span class="s1">&#39;yahoo-dom-event&#39;</span><span class="p">,</span> <span class="s1">&#39;get&#39;</span><span class="p">,</span> <span class="s1">&#39;yuiloader&#39;</span><span class="p">,</span> <span class="s1">&#39;yuiloader-dom-event&#39;</span><span class="p">],</span>
            <span class="s1">&#39;rollup&#39;</span><span class="o">:</span> <span class="mi">8</span>
        <span class="p">},</span>

        <span class="s1">&#39;yahoo&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;yahoo/yahoo-min.js&#39;</span>
        <span class="p">},</span>

        <span class="s1">&#39;yahoo-dom-event&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;yahoo-dom-event/yahoo-dom-event.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;supersedes&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">,</span> <span class="s1">&#39;event&#39;</span><span class="p">,</span> <span class="s1">&#39;dom&#39;</span><span class="p">],</span>
            <span class="s1">&#39;rollup&#39;</span><span class="o">:</span> <span class="mi">3</span>
        <span class="p">},</span>

        <span class="s1">&#39;yuiloader&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;yuiloader/yuiloader-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;supersedes&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">,</span> <span class="s1">&#39;get&#39;</span><span class="p">]</span>
        <span class="p">},</span>

        <span class="s1">&#39;yuiloader-dom-event&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;yuiloader-dom-event/yuiloader-dom-event.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;supersedes&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;yahoo&#39;</span><span class="p">,</span> <span class="s1">&#39;dom&#39;</span><span class="p">,</span> <span class="s1">&#39;event&#39;</span><span class="p">,</span> <span class="s1">&#39;get&#39;</span><span class="p">,</span> <span class="s1">&#39;yuiloader&#39;</span><span class="p">,</span> <span class="s1">&#39;yahoo-dom-event&#39;</span><span class="p">],</span>
            <span class="s1">&#39;rollup&#39;</span><span class="o">:</span> <span class="mi">5</span>
        <span class="p">},</span>

        <span class="s1">&#39;yuitest&#39;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="s1">&#39;yuitest/yuitest-min.js&#39;</span><span class="p">,</span>
            <span class="s1">&#39;requires&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;logger&#39;</span><span class="p">],</span>
            <span class="s1">&#39;optional&#39;</span><span class="o">:</span> <span class="p">[</span><span class="s1">&#39;event-simulate&#39;</span><span class="p">],</span>
            <span class="s1">&#39;skinnable&#39;</span><span class="o">:</span> <span class="kc">true</span>
        <span class="p">}</span>
    <span class="p">}</span>
<span class="p">},</span>
        <span class="nx">ObjectUtil</span><span class="o">:</span> <span class="p">{</span>
            <span class="nx">appendArray</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">a</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">a</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">o</span><span class="p">[</span><span class="nx">a</span><span class="p">[</span><span class="nx">i</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">},</span>

            <span class="nx">keys</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">ordered</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">a</span><span class="o">=</span><span class="p">[],</span> <span class="nx">i</span><span class="p">;</span>
                <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="k">in</span> <span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">a</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
                    <span class="p">}</span>
                <span class="p">}</span>

                <span class="k">return</span> <span class="nx">a</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">},</span>

        <span class="nx">ArrayUtil</span><span class="o">:</span> <span class="p">{</span>

            <span class="nx">appendArray</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">a1</span><span class="p">,</span> <span class="nx">a2</span><span class="p">)</span> <span class="p">{</span>
                <span class="nb">Array</span><span class="p">.</span><span class="nx">prototype</span><span class="p">.</span><span class="nx">push</span><span class="p">.</span><span class="nx">apply</span><span class="p">(</span><span class="nx">a1</span><span class="p">,</span> <span class="nx">a2</span><span class="p">);</span>
                <span class="cm">/*</span>
<span class="cm">                for (var i=0; i&lt;a2.length; i=i+1) {</span>
<span class="cm">                    a1.push(a2[i]);</span>
<span class="cm">                }</span>
<span class="cm">                */</span>
            <span class="p">},</span>

            <span class="nx">indexOf</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">val</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">a</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">a</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">===</span> <span class="nx">val</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">return</span> <span class="nx">i</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>

                <span class="k">return</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span>
            <span class="p">},</span>

            <span class="nx">toObject</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">o</span> <span class="o">=</span> <span class="p">{};</span>
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">a</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">o</span><span class="p">[</span><span class="nx">a</span><span class="p">[</span><span class="nx">i</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="k">return</span> <span class="nx">o</span><span class="p">;</span>
            <span class="p">},</span>

            <span class="cm">/*</span>
<span class="cm">             * Returns a unique array.  Does not maintain order, which is fine</span>
<span class="cm">             * for this application, and performs better than it would if it</span>
<span class="cm">             * did.</span>
<span class="cm">             */</span>
            <span class="nx">uniq</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">a</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">YUI</span><span class="p">.</span><span class="nx">ObjectUtil</span><span class="p">.</span><span class="nx">keys</span><span class="p">(</span><span class="nx">YUI</span><span class="p">.</span><span class="nx">ArrayUtil</span><span class="p">.</span><span class="nx">toObject</span><span class="p">(</span><span class="nx">a</span><span class="p">));</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">};</span>

    <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">YUILoader</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>

        <span class="cm">/**</span>
<span class="cm">         * Internal callback to handle multiple internal insert() calls</span>
<span class="cm">         * so that css is inserted prior to js</span>
<span class="cm">         * @property _internalCallback</span>
<span class="cm">         * @private</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_internalCallback</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * Use the YAHOO environment listener to detect script load.  This</span>
<span class="cm">         * is only switched on for Safari 2.x and below.</span>
<span class="cm">         * @property _useYahooListener</span>
<span class="cm">         * @private</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">_useYahooListener</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * Callback that will be executed when the loader is finished</span>
<span class="cm">         * with an insert</span>
<span class="cm">         * @method onSuccess</span>
<span class="cm">         * @type function</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">onSuccess</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * Callback that will be executed if there is a failure</span>
<span class="cm">         * @method onFailure</span>
<span class="cm">         * @type function</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">onFailure</span> <span class="o">=</span> <span class="nx">Y</span><span class="p">.</span><span class="nx">log</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * Callback that will be executed each time a new module is loaded</span>
<span class="cm">         * @method onProgress</span>
<span class="cm">         * @type function</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">onProgress</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * Callback that will be executed if a timeout occurs</span>
<span class="cm">         * @method onTimeout</span>
<span class="cm">         * @type function</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">onTimeout</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * The execution scope for all callbacks</span>
<span class="cm">         * @property scope</span>
<span class="cm">         * @default this</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">scope</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * Data that is passed to all callbacks</span>
<span class="cm">         * @property data</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">data</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * Node reference or id where new nodes should be inserted before</span>
<span class="cm">         * @property insertBefore</span>
<span class="cm">         * @type string|HTMLElement</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">insertBefore</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * The charset attribute for inserted nodes</span>
<span class="cm">         * @property charset</span>
<span class="cm">         * @type string</span>
<span class="cm">         * @default utf-8</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">charset</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * The name of the variable in a sandbox or script node</span>
<span class="cm">         * (for external script support in Safari 2.x and earlier)</span>
<span class="cm">         * to reference when the load is complete.  If this variable</span>
<span class="cm">         * is not available in the specified scripts, the operation will</span>
<span class="cm">         * fail.</span>
<span class="cm">         * @property varName</span>
<span class="cm">         * @type string</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">varName</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * The base directory.</span>
<span class="cm">         * @property base</span>
<span class="cm">         * @type string</span>
<span class="cm">         * @default http://yui.yahooapis.com/[YUI VERSION]/build/</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">base</span> <span class="o">=</span> <span class="nx">YUI</span><span class="p">.</span><span class="nx">info</span><span class="p">.</span><span class="nx">base</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * Base path for the combo service</span>
<span class="cm">         * @property comboBase</span>
<span class="cm">         * @type string</span>
<span class="cm">         * @default http://yui.yahooapis.com/combo?</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">comboBase</span> <span class="o">=</span> <span class="nx">YUI</span><span class="p">.</span><span class="nx">info</span><span class="p">.</span><span class="nx">comboBase</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * If configured, YUI will use the the combo handler on the</span>
<span class="cm">         * Yahoo! CDN to pontentially reduce the number of http requests</span>
<span class="cm">         * required.</span>
<span class="cm">         * @property combine</span>
<span class="cm">         * @type boolean</span>
<span class="cm">         * @default false</span>
<span class="cm">         */</span>
        <span class="c1">// this.combine = (o &amp;&amp; !(&#39;base&#39; in o));</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">combine</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>


        <span class="cm">/**</span>
<span class="cm">         * Root path to prepend to module path for the combo</span>
<span class="cm">         * service</span>
<span class="cm">         * @property root</span>
<span class="cm">         * @type string</span>
<span class="cm">         * @default [YUI VERSION]/build/</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">root</span> <span class="o">=</span> <span class="nx">YUI</span><span class="p">.</span><span class="nx">info</span><span class="p">.</span><span class="nx">root</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * Timeout value in milliseconds.  If set, this value will be used by</span>
<span class="cm">         * the get utility.  the timeout event will fire if</span>
<span class="cm">         * a timeout occurs.</span>
<span class="cm">         * @property timeout</span>
<span class="cm">         * @type int</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">timeout</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * A list of modules that should not be loaded, even if</span>
<span class="cm">         * they turn up in the dependency tree</span>
<span class="cm">         * @property ignore</span>
<span class="cm">         * @type string[]</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">ignore</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * A list of modules that should always be loaded, even</span>
<span class="cm">         * if they have already been inserted into the page.</span>
<span class="cm">         * @property force</span>
<span class="cm">         * @type string[]</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">force</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * Should we allow rollups</span>
<span class="cm">         * @property allowRollup</span>
<span class="cm">         * @type boolean</span>
<span class="cm">         * @default true</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">allowRollup</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * A filter to apply to result urls.  This filter will modify the default</span>
<span class="cm">         * path for all modules.  The default path for the YUI library is the</span>
<span class="cm">         * minified version of the files (e.g., event-min.js).  The filter property</span>
<span class="cm">         * can be a predefined filter or a custom filter.  The valid predefined</span>
<span class="cm">         * filters are:</span>
<span class="cm">         * &lt;dl&gt;</span>
<span class="cm">         *  &lt;dt&gt;DEBUG&lt;/dt&gt;</span>
<span class="cm">         *  &lt;dd&gt;Selects the debug versions of the library (e.g., event-debug.js).</span>
<span class="cm">         *      This option will automatically include the logger widget&lt;/dd&gt;</span>
<span class="cm">         *  &lt;dt&gt;RAW&lt;/dt&gt;</span>
<span class="cm">         *  &lt;dd&gt;Selects the non-minified version of the library (e.g., event.js).</span>
<span class="cm">         * &lt;/dl&gt;</span>
<span class="cm">         * You can also define a custom filter, which must be an object literal</span>
<span class="cm">         * containing a search expression and a replace string:</span>
<span class="cm">         * &lt;pre&gt;</span>
<span class="cm">         *  myFilter: &amp;#123;</span>
<span class="cm">         *      &#39;searchExp&#39;: &quot;-min\\.js&quot;,</span>
<span class="cm">         *      &#39;replaceStr&#39;: &quot;-debug.js&quot;</span>
<span class="cm">         *  &amp;#125;</span>
<span class="cm">         * &lt;/pre&gt;</span>
<span class="cm">         * @property filter</span>
<span class="cm">         * @type string|{searchExp: string, replaceStr: string}</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">filter</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * The list of requested modules</span>
<span class="cm">         * @property required</span>
<span class="cm">         * @type {string: boolean}</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">required</span> <span class="o">=</span> <span class="p">{};</span>

        <span class="cm">/**</span>
<span class="cm">         * The library metadata</span>
<span class="cm">         * @property moduleInfo</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">merge</span><span class="p">(</span><span class="nx">YUI</span><span class="p">.</span><span class="nx">info</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">);</span>

        <span class="cm">/**</span>
<span class="cm">         * List of rollup files found in the library metadata</span>
<span class="cm">         * @property rollups</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">rollups</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * Whether or not to load optional dependencies for</span>
<span class="cm">         * the requested modules</span>
<span class="cm">         * @property loadOptional</span>
<span class="cm">         * @type boolean</span>
<span class="cm">         * @default false</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">loadOptional</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * All of the derived dependencies in sorted order, which</span>
<span class="cm">         * will be populated when either calculate() or insert()</span>
<span class="cm">         * is called</span>
<span class="cm">         * @property sorted</span>
<span class="cm">         * @type string[]</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">sorted</span> <span class="o">=</span> <span class="p">[];</span>

        <span class="cm">/**</span>
<span class="cm">         * Set when beginning to compute the dependency tree.</span>
<span class="cm">         * Composed of what YAHOO reports to be loaded combined</span>
<span class="cm">         * with what has been loaded by the tool</span>
<span class="cm">         * @propery loaded</span>
<span class="cm">         * @type {string: boolean}</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">loaded</span> <span class="o">=</span> <span class="p">{};</span>

        <span class="cm">/**</span>
<span class="cm">         * Flag to indicate the dependency tree needs to be recomputed</span>
<span class="cm">         * if insert is called again.</span>
<span class="cm">         * @property dirty</span>
<span class="cm">         * @type boolean</span>
<span class="cm">         * @default true</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">dirty</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

        <span class="cm">/**</span>
<span class="cm">         * List of modules inserted by the utility</span>
<span class="cm">         * @property inserted</span>
<span class="cm">         * @type {string: boolean}</span>
<span class="cm">         */</span>
        <span class="k">this</span><span class="p">.</span><span class="nx">inserted</span> <span class="o">=</span> <span class="p">{};</span>

        <span class="cm">/**</span>
<span class="cm">         * Provides the information used to skin the skinnable components.</span>
<span class="cm">         * The following skin definition would result in &#39;skin1&#39; and &#39;skin2&#39;</span>
<span class="cm">         * being loaded for calendar (if calendar was requested), and</span>
<span class="cm">         * &#39;sam&#39; for all other skinnable components:</span>
<span class="cm">         *</span>
<span class="cm">         *   &lt;code&gt;</span>
<span class="cm">         *   skin: {</span>
<span class="cm">         *</span>
<span class="cm">         *      // The default skin, which is automatically applied if not</span>
<span class="cm">         *      // overriden by a component-specific skin definition.</span>
<span class="cm">         *      // Change this in to apply a different skin globally</span>
<span class="cm">         *      defaultSkin: &#39;sam&#39;,</span>
<span class="cm">         *</span>
<span class="cm">         *      // This is combined with the loader base property to get</span>
<span class="cm">         *      // the default root directory for a skin. ex:</span>
<span class="cm">         *      // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/</span>
<span class="cm">         *      base: &#39;assets/skins/&#39;,</span>
<span class="cm">         *</span>
<span class="cm">         *      // The name of the rollup css file for the skin</span>
<span class="cm">         *      path: &#39;skin.css&#39;,</span>
<span class="cm">         *</span>
<span class="cm">         *      // The number of skinnable components requested that are</span>
<span class="cm">         *      // required before using the rollup file rather than the</span>
<span class="cm">         *      // individual component css files</span>
<span class="cm">         *      rollup: 3,</span>
<span class="cm">         *</span>
<span class="cm">         *      // Any component-specific overrides can be specified here,</span>
<span class="cm">         *      // making it possible to load different skins for different</span>
<span class="cm">         *      // components.  It is possible to load more than one skin</span>
<span class="cm">         *      // for a given component as well.</span>
<span class="cm">         *      overrides: {</span>
<span class="cm">         *          calendar: [&#39;skin1&#39;, &#39;skin2&#39;]</span>
<span class="cm">         *      }</span>
<span class="cm">         *   }</span>
<span class="cm">         *   &lt;/code&gt;</span>
<span class="cm">         *   @property skin</span>
<span class="cm">         */</span>

        <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>

        <span class="nx">env</span><span class="p">.</span><span class="nx">listeners</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">m</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">self</span><span class="p">.</span><span class="nx">_useYahooListener</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">//Y.log(&quot;YAHOO listener: &quot; + m.name);</span>
                <span class="nx">self</span><span class="p">.</span><span class="nx">loadNext</span><span class="p">(</span><span class="nx">m</span><span class="p">.</span><span class="nx">name</span><span class="p">);</span>
            <span class="p">}</span>
        <span class="p">});</span>

        <span class="k">this</span><span class="p">.</span><span class="nx">skin</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">merge</span><span class="p">(</span><span class="nx">YUI</span><span class="p">.</span><span class="nx">info</span><span class="p">.</span><span class="nx">skin</span><span class="p">);</span>

        <span class="k">this</span><span class="p">.</span><span class="nx">_config</span><span class="p">(</span><span class="nx">o</span><span class="p">);</span>

    <span class="p">};</span>

    <span class="nx">Y</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">YUILoader</span><span class="p">.</span><span class="nx">prototype</span> <span class="o">=</span> <span class="p">{</span>

        <span class="nx">FILTERS</span><span class="o">:</span> <span class="p">{</span>
            <span class="nx">RAW</span><span class="o">:</span> <span class="p">{</span>
                <span class="s1">&#39;searchExp&#39;</span><span class="o">:</span> <span class="s2">&quot;-min\\.js&quot;</span><span class="p">,</span>
                <span class="s1">&#39;replaceStr&#39;</span><span class="o">:</span> <span class="s2">&quot;.js&quot;</span>
            <span class="p">},</span>
            <span class="nx">DEBUG</span><span class="o">:</span> <span class="p">{</span>
                <span class="s1">&#39;searchExp&#39;</span><span class="o">:</span> <span class="s2">&quot;-min\\.js&quot;</span><span class="p">,</span>
                <span class="s1">&#39;replaceStr&#39;</span><span class="o">:</span> <span class="s2">&quot;-debug.js&quot;</span>
            <span class="p">}</span>
        <span class="p">},</span>

        <span class="nx">SKIN_PREFIX</span><span class="o">:</span> <span class="s2">&quot;skin-&quot;</span><span class="p">,</span>

        <span class="nx">_config</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>

            <span class="c1">// apply config values</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">i</span> <span class="o">==</span> <span class="s2">&quot;require&quot;</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">require</span><span class="p">(</span><span class="nx">o</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">o</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="c1">// fix filter</span>
            <span class="kd">var</span> <span class="nx">f</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">filter</span><span class="p">;</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">isString</span><span class="p">(</span><span class="nx">f</span><span class="p">))</span> <span class="p">{</span>
                <span class="nx">f</span> <span class="o">=</span> <span class="nx">f</span><span class="p">.</span><span class="nx">toUpperCase</span><span class="p">();</span>

                <span class="c1">// the logger must be available in order to use the debug</span>
                <span class="c1">// versions of the library</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">f</span> <span class="o">===</span> <span class="s2">&quot;DEBUG&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">require</span><span class="p">(</span><span class="s2">&quot;logger&quot;</span><span class="p">);</span>
                <span class="p">}</span>

                <span class="c1">// hack to handle a a bug where LogWriter is being instantiated</span>
                <span class="c1">// at load time, and the loader has no way to sort above it</span>
                <span class="c1">// at the moment.</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">Y</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">LogWriter</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">Y</span><span class="p">.</span><span class="nx">widget</span><span class="p">.</span><span class="nx">LogWriter</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                        <span class="k">return</span> <span class="nx">Y</span><span class="p">;</span>
                    <span class="p">};</span>
                <span class="p">}</span>

                <span class="k">this</span><span class="p">.</span><span class="nx">filter</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">FILTERS</span><span class="p">[</span><span class="nx">f</span><span class="p">];</span>
            <span class="p">}</span>

        <span class="p">},</span>

        <span class="cm">/** Add a new module to the component metadata.</span>
<span class="cm">         * &lt;dl&gt;</span>
<span class="cm">         *     &lt;dt&gt;name:&lt;/dt&gt;       &lt;dd&gt;required, the component name&lt;/dd&gt;</span>
<span class="cm">         *     &lt;dt&gt;type:&lt;/dt&gt;       &lt;dd&gt;required, the component type (js or css)&lt;/dd&gt;</span>
<span class="cm">         *     &lt;dt&gt;path:&lt;/dt&gt;       &lt;dd&gt;required, the path to the script from &quot;base&quot;&lt;/dd&gt;</span>
<span class="cm">         *     &lt;dt&gt;requires:&lt;/dt&gt;   &lt;dd&gt;array of modules required by this component&lt;/dd&gt;</span>
<span class="cm">         *     &lt;dt&gt;optional:&lt;/dt&gt;   &lt;dd&gt;array of optional modules for this component&lt;/dd&gt;</span>
<span class="cm">         *     &lt;dt&gt;supersedes:&lt;/dt&gt; &lt;dd&gt;array of the modules this component replaces&lt;/dd&gt;</span>
<span class="cm">         *     &lt;dt&gt;after:&lt;/dt&gt;      &lt;dd&gt;array of modules the components which, if present, should be sorted above this one&lt;/dd&gt;</span>
<span class="cm">         *     &lt;dt&gt;rollup:&lt;/dt&gt;     &lt;dd&gt;the number of superseded modules required for automatic rollup&lt;/dd&gt;</span>
<span class="cm">         *     &lt;dt&gt;fullpath:&lt;/dt&gt;   &lt;dd&gt;If fullpath is specified, this is used instead of the configured base + path&lt;/dd&gt;</span>
<span class="cm">         *     &lt;dt&gt;skinnable:&lt;/dt&gt;  &lt;dd&gt;flag to determine if skin assets should automatically be pulled in&lt;/dd&gt;</span>
<span class="cm">         * &lt;/dl&gt;</span>
<span class="cm">         * @method addModule</span>
<span class="cm">         * @param o An object containing the module data</span>
<span class="cm">         * @return {boolean} true if the module was added, false if</span>
<span class="cm">         * the object passed in did not provide all required attributes</span>
<span class="cm">         */</span>
        <span class="nx">addModule</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">o</span> <span class="o">||</span> <span class="o">!</span><span class="nx">o</span><span class="p">.</span><span class="nx">name</span> <span class="o">||</span> <span class="o">!</span><span class="nx">o</span><span class="p">.</span><span class="nx">type</span> <span class="o">||</span> <span class="p">(</span><span class="o">!</span><span class="nx">o</span><span class="p">.</span><span class="nx">path</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">o</span><span class="p">.</span><span class="nx">fullpath</span><span class="p">))</span> <span class="p">{</span>
                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="nx">o</span><span class="p">.</span><span class="nx">ext</span> <span class="o">=</span> <span class="p">(</span><span class="s1">&#39;ext&#39;</span> <span class="k">in</span> <span class="nx">o</span><span class="p">)</span> <span class="o">?</span> <span class="nx">o</span><span class="p">.</span><span class="nx">ext</span> <span class="o">:</span> <span class="kc">true</span><span class="p">;</span>
            <span class="nx">o</span><span class="p">.</span><span class="nx">requires</span> <span class="o">=</span> <span class="nx">o</span><span class="p">.</span><span class="nx">requires</span> <span class="o">||</span> <span class="p">[];</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">[</span><span class="nx">o</span><span class="p">.</span><span class="nx">name</span><span class="p">]</span> <span class="o">=</span> <span class="nx">o</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">dirty</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

            <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Add a requirement for one or more module</span>
<span class="cm">         * @method require</span>
<span class="cm">         * @param what {string[] | string*} the modules to load</span>
<span class="cm">         */</span>
        <span class="nx">require</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">what</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="p">(</span><span class="k">typeof</span> <span class="nx">what</span> <span class="o">===</span> <span class="s2">&quot;string&quot;</span><span class="p">)</span> <span class="o">?</span> <span class="nx">arguments</span> <span class="o">:</span> <span class="nx">what</span><span class="p">;</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">dirty</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
            <span class="nx">YUI</span><span class="p">.</span><span class="nx">ObjectUtil</span><span class="p">.</span><span class="nx">appendArray</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">required</span><span class="p">,</span> <span class="nx">a</span><span class="p">);</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Adds the skin def to the module info</span>
<span class="cm">         * @method _addSkin</span>
<span class="cm">         * @param skin {string} the name of the skin</span>
<span class="cm">         * @param mod {string} the name of the module</span>
<span class="cm">         * @return {string} the module name for the skin</span>
<span class="cm">         * @private</span>
<span class="cm">         */</span>
        <span class="nx">_addSkin</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">skin</span><span class="p">,</span> <span class="nx">mod</span><span class="p">)</span> <span class="p">{</span>

            <span class="c1">// Add a module definition for the skin rollup css</span>
            <span class="kd">var</span> <span class="nx">name</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">formatSkin</span><span class="p">(</span><span class="nx">skin</span><span class="p">),</span> <span class="nx">info</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">,</span>
                <span class="nx">sinf</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">skin</span><span class="p">,</span> <span class="nx">ext</span> <span class="o">=</span> <span class="nx">info</span><span class="p">[</span><span class="nx">mod</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="nx">info</span><span class="p">[</span><span class="nx">mod</span><span class="p">].</span><span class="nx">ext</span><span class="p">;</span>

            <span class="c1">// Y.log(&#39;ext? &#39; + mod + &quot;: &quot; + ext);</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">info</span><span class="p">[</span><span class="nx">name</span><span class="p">])</span> <span class="p">{</span>
                <span class="c1">// Y.log(&#39;adding skin &#39; + name);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">addModule</span><span class="p">({</span>
                    <span class="s1">&#39;name&#39;</span><span class="o">:</span> <span class="nx">name</span><span class="p">,</span>
                    <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;css&#39;</span><span class="p">,</span>
                    <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="nx">sinf</span><span class="p">.</span><span class="nx">base</span> <span class="o">+</span> <span class="nx">skin</span> <span class="o">+</span> <span class="s1">&#39;/&#39;</span> <span class="o">+</span> <span class="nx">sinf</span><span class="p">.</span><span class="nx">path</span><span class="p">,</span>
                    <span class="c1">//&#39;supersedes&#39;: &#39;*&#39;,</span>
                    <span class="s1">&#39;after&#39;</span><span class="o">:</span> <span class="nx">sinf</span><span class="p">.</span><span class="nx">after</span><span class="p">,</span>
                    <span class="s1">&#39;rollup&#39;</span><span class="o">:</span> <span class="nx">sinf</span><span class="p">.</span><span class="nx">rollup</span><span class="p">,</span>
                    <span class="s1">&#39;ext&#39;</span><span class="o">:</span> <span class="nx">ext</span>
                <span class="p">});</span>
            <span class="p">}</span>

            <span class="c1">// Add a module definition for the module-specific skin css</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">mod</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">name</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">formatSkin</span><span class="p">(</span><span class="nx">skin</span><span class="p">,</span> <span class="nx">mod</span><span class="p">);</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">info</span><span class="p">[</span><span class="nx">name</span><span class="p">])</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">mdef</span> <span class="o">=</span> <span class="nx">info</span><span class="p">[</span><span class="nx">mod</span><span class="p">],</span> <span class="nx">pkg</span> <span class="o">=</span> <span class="nx">mdef</span><span class="p">.</span><span class="nx">pkg</span> <span class="o">||</span> <span class="nx">mod</span><span class="p">;</span>
                    <span class="c1">// Y.log(&#39;adding skin &#39; + name);</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">addModule</span><span class="p">({</span>
                        <span class="s1">&#39;name&#39;</span><span class="o">:</span> <span class="nx">name</span><span class="p">,</span>
                        <span class="s1">&#39;type&#39;</span><span class="o">:</span> <span class="s1">&#39;css&#39;</span><span class="p">,</span>
                        <span class="s1">&#39;after&#39;</span><span class="o">:</span> <span class="nx">sinf</span><span class="p">.</span><span class="nx">after</span><span class="p">,</span>
                        <span class="s1">&#39;path&#39;</span><span class="o">:</span> <span class="nx">pkg</span> <span class="o">+</span> <span class="s1">&#39;/&#39;</span> <span class="o">+</span> <span class="nx">sinf</span><span class="p">.</span><span class="nx">base</span> <span class="o">+</span> <span class="nx">skin</span> <span class="o">+</span> <span class="s1">&#39;/&#39;</span> <span class="o">+</span> <span class="nx">mod</span> <span class="o">+</span> <span class="s1">&#39;.css&#39;</span><span class="p">,</span>
                        <span class="s1">&#39;ext&#39;</span><span class="o">:</span> <span class="nx">ext</span>
                    <span class="p">});</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="k">return</span> <span class="nx">name</span><span class="p">;</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Returns an object containing properties for all modules required</span>
<span class="cm">         * in order to load the requested module</span>
<span class="cm">         * @method getRequires</span>
<span class="cm">         * @param mod The module definition from moduleInfo</span>
<span class="cm">         */</span>
        <span class="nx">getRequires</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">mod</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">mod</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="p">[];</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">dirty</span> <span class="o">&amp;&amp;</span> <span class="nx">mod</span><span class="p">.</span><span class="nx">expanded</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">mod</span><span class="p">.</span><span class="nx">expanded</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="nx">mod</span><span class="p">.</span><span class="nx">requires</span><span class="o">=</span><span class="nx">mod</span><span class="p">.</span><span class="nx">requires</span> <span class="o">||</span> <span class="p">[];</span>
            <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">d</span><span class="o">=</span><span class="p">[],</span> <span class="nx">r</span><span class="o">=</span><span class="nx">mod</span><span class="p">.</span><span class="nx">requires</span><span class="p">,</span> <span class="nx">o</span><span class="o">=</span><span class="nx">mod</span><span class="p">.</span><span class="nx">optional</span><span class="p">,</span> <span class="nx">info</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">,</span> <span class="nx">m</span><span class="p">;</span>
            <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">r</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">d</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">r</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                <span class="nx">m</span> <span class="o">=</span> <span class="nx">info</span><span class="p">[</span><span class="nx">r</span><span class="p">[</span><span class="nx">i</span><span class="p">]];</span>
                <span class="nx">YUI</span><span class="p">.</span><span class="nx">ArrayUtil</span><span class="p">.</span><span class="nx">appendArray</span><span class="p">(</span><span class="nx">d</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRequires</span><span class="p">(</span><span class="nx">m</span><span class="p">));</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">o</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">loadOptional</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">o</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">d</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">o</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                    <span class="nx">YUI</span><span class="p">.</span><span class="nx">ArrayUtil</span><span class="p">.</span><span class="nx">appendArray</span><span class="p">(</span><span class="nx">d</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRequires</span><span class="p">(</span><span class="nx">info</span><span class="p">[</span><span class="nx">o</span><span class="p">[</span><span class="nx">i</span><span class="p">]]));</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="nx">mod</span><span class="p">.</span><span class="nx">expanded</span> <span class="o">=</span> <span class="nx">YUI</span><span class="p">.</span><span class="nx">ArrayUtil</span><span class="p">.</span><span class="nx">uniq</span><span class="p">(</span><span class="nx">d</span><span class="p">);</span>

            <span class="k">return</span> <span class="nx">mod</span><span class="p">.</span><span class="nx">expanded</span><span class="p">;</span>
        <span class="p">},</span>


        <span class="cm">/**</span>
<span class="cm">         * Returns an object literal of the modules the supplied module satisfies</span>
<span class="cm">         * @method getProvides</span>
<span class="cm">         * @param name{string} The name of the module</span>
<span class="cm">         * @param notMe {string} don&#39;t add this module name, only include superseded modules</span>
<span class="cm">         * @return what this module provides</span>
<span class="cm">         */</span>
        <span class="nx">getProvides</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">name</span><span class="p">,</span> <span class="nx">notMe</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">addMe</span> <span class="o">=</span> <span class="o">!</span><span class="p">(</span><span class="nx">notMe</span><span class="p">),</span> <span class="nx">ckey</span> <span class="o">=</span> <span class="p">(</span><span class="nx">addMe</span><span class="p">)</span> <span class="o">?</span> <span class="nx">PROV</span> <span class="o">:</span> <span class="nx">SUPER</span><span class="p">,</span>
                <span class="nx">m</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">[</span><span class="nx">name</span><span class="p">],</span> <span class="nx">o</span> <span class="o">=</span> <span class="p">{};</span>

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">m</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="nx">o</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">m</span><span class="p">[</span><span class="nx">ckey</span><span class="p">])</span> <span class="p">{</span>
<span class="c1">// Y.log(&#39;cached: &#39; + name + &#39; &#39; + ckey + &#39; &#39; + lang.dump(this.moduleInfo[name][ckey], 0));</span>
                <span class="k">return</span> <span class="nx">m</span><span class="p">[</span><span class="nx">ckey</span><span class="p">];</span>
            <span class="p">}</span>

            <span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="nx">m</span><span class="p">.</span><span class="nx">supersedes</span><span class="p">,</span> <span class="nx">done</span><span class="o">=</span><span class="p">{},</span> <span class="nx">me</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>

            <span class="c1">// use worker to break cycles</span>
            <span class="kd">var</span> <span class="nx">add</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">mm</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">done</span><span class="p">[</span><span class="nx">mm</span><span class="p">])</span> <span class="p">{</span>
                    <span class="c1">// Y.log(name + &#39; provides worker trying: &#39; + mm);</span>
                    <span class="nx">done</span><span class="p">[</span><span class="nx">mm</span><span class="p">]</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="c1">// we always want the return value normal behavior</span>
                    <span class="c1">// (provides) for superseded modules.</span>
                    <span class="nx">lang</span><span class="p">.</span><span class="nx">augmentObject</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">me</span><span class="p">.</span><span class="nx">getProvides</span><span class="p">(</span><span class="nx">mm</span><span class="p">));</span>
                <span class="p">}</span>

                <span class="c1">// else {</span>
                <span class="c1">// Y.log(name + &#39; provides worker skipping done: &#39; + mm);</span>
                <span class="c1">// }</span>
            <span class="p">};</span>

            <span class="c1">// calculate superseded modules</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">s</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">s</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">add</span><span class="p">(</span><span class="nx">s</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="c1">// supersedes cache</span>
            <span class="nx">m</span><span class="p">[</span><span class="nx">SUPER</span><span class="p">]</span> <span class="o">=</span> <span class="nx">o</span><span class="p">;</span>
            <span class="c1">// provides cache</span>
            <span class="nx">m</span><span class="p">[</span><span class="nx">PROV</span><span class="p">]</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">merge</span><span class="p">(</span><span class="nx">o</span><span class="p">);</span>
            <span class="nx">m</span><span class="p">[</span><span class="nx">PROV</span><span class="p">][</span><span class="nx">name</span><span class="p">]</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

<span class="c1">// Y.log(name + &quot; supersedes &quot; + lang.dump(m[SUPER], 0));</span>
<span class="c1">// Y.log(name + &quot; provides &quot; + lang.dump(m[PROV], 0));</span>

            <span class="k">return</span> <span class="nx">m</span><span class="p">[</span><span class="nx">ckey</span><span class="p">];</span>
        <span class="p">},</span>


        <span class="cm">/**</span>
<span class="cm">         * Calculates the dependency tree, the result is stored in the sorted</span>
<span class="cm">         * property</span>
<span class="cm">         * @method calculate</span>
<span class="cm">         * @param o optional options object</span>
<span class="cm">         */</span>
        <span class="nx">calculate</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">o</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">dirty</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_config</span><span class="p">(</span><span class="nx">o</span><span class="p">);</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_setup</span><span class="p">();</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_explode</span><span class="p">();</span>
                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">allowRollup</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">_rollup</span><span class="p">();</span>
                <span class="p">}</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_reduce</span><span class="p">();</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_sort</span><span class="p">();</span>

                <span class="c1">// Y.log(&quot;after calculate: &quot; + lang.dump(this.required));</span>

                <span class="k">this</span><span class="p">.</span><span class="nx">dirty</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">}</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Investigates the current YUI configuration on the page.  By default,</span>
<span class="cm">         * modules already detected will not be loaded again unless a force</span>
<span class="cm">         * option is encountered.  Called by calculate()</span>
<span class="cm">         * @method _setup</span>
<span class="cm">         * @private</span>
<span class="cm">         */</span>
        <span class="nx">_setup</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>

            <span class="kd">var</span> <span class="nx">info</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">,</span> <span class="nx">name</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">j</span><span class="p">;</span>

            <span class="c1">// Create skin modules</span>
            <span class="k">for</span> <span class="p">(</span><span class="nx">name</span> <span class="k">in</span> <span class="nx">info</span><span class="p">)</span> <span class="p">{</span>

                <span class="k">if</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">info</span><span class="p">,</span> <span class="nx">name</span><span class="p">))</span> <span class="p">{</span>
                    <span class="kd">var</span> <span class="nx">m</span> <span class="o">=</span> <span class="nx">info</span><span class="p">[</span><span class="nx">name</span><span class="p">];</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">m</span> <span class="o">&amp;&amp;</span> <span class="nx">m</span><span class="p">.</span><span class="nx">skinnable</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">// Y.log(&quot;skinning: &quot; + name);</span>
                        <span class="kd">var</span> <span class="nx">o</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">skin</span><span class="p">.</span><span class="nx">overrides</span><span class="p">,</span> <span class="nx">smod</span><span class="p">;</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">o</span> <span class="o">&amp;&amp;</span> <span class="nx">o</span><span class="p">[</span><span class="nx">name</span><span class="p">])</span> <span class="p">{</span>
                            <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">o</span><span class="p">[</span><span class="nx">name</span><span class="p">].</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                                <span class="nx">smod</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_addSkin</span><span class="p">(</span><span class="nx">o</span><span class="p">[</span><span class="nx">name</span><span class="p">][</span><span class="nx">i</span><span class="p">],</span> <span class="nx">name</span><span class="p">);</span>
                            <span class="p">}</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="nx">smod</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_addSkin</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">skin</span><span class="p">.</span><span class="nx">defaultSkin</span><span class="p">,</span> <span class="nx">name</span><span class="p">);</span>
                        <span class="p">}</span>

                        <span class="k">if</span> <span class="p">(</span><span class="nx">YUI</span><span class="p">.</span><span class="nx">ArrayUtil</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">m</span><span class="p">.</span><span class="nx">requires</span><span class="p">,</span> <span class="nx">smod</span><span class="p">)</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">m</span><span class="p">.</span><span class="nx">requires</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">smod</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>

            <span class="p">}</span>

            <span class="kd">var</span> <span class="nx">l</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">merge</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">inserted</span><span class="p">);</span> <span class="c1">// shallow clone</span>

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_sandbox</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">l</span> <span class="o">=</span> <span class="nx">lang</span><span class="p">.</span><span class="nx">merge</span><span class="p">(</span><span class="nx">l</span><span class="p">,</span> <span class="nx">env</span><span class="p">.</span><span class="nx">modules</span><span class="p">);</span>
            <span class="p">}</span>

            <span class="c1">// Y.log(&quot;Already loaded stuff: &quot; + lang.dump(l, 0));</span>

            <span class="c1">// add the ignore list to the list of loaded packages</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">ignore</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">YUI</span><span class="p">.</span><span class="nx">ObjectUtil</span><span class="p">.</span><span class="nx">appendArray</span><span class="p">(</span><span class="nx">l</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">ignore</span><span class="p">);</span>
            <span class="p">}</span>

            <span class="c1">// remove modules on the force list from the loaded list</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">force</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="k">this</span><span class="p">.</span><span class="nx">force</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">force</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="k">in</span> <span class="nx">l</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">delete</span> <span class="nx">l</span><span class="p">[</span><span class="k">this</span><span class="p">.</span><span class="nx">force</span><span class="p">[</span><span class="nx">i</span><span class="p">]];</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="c1">// expand the list to include superseded modules</span>
            <span class="k">for</span> <span class="p">(</span><span class="nx">j</span> <span class="k">in</span> <span class="nx">l</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Y.log(&quot;expanding: &quot; + j);</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">l</span><span class="p">,</span> <span class="nx">j</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">lang</span><span class="p">.</span><span class="nx">augmentObject</span><span class="p">(</span><span class="nx">l</span><span class="p">,</span> <span class="k">this</span><span class="p">.</span><span class="nx">getProvides</span><span class="p">(</span><span class="nx">j</span><span class="p">));</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="c1">// Y.log(&quot;loaded expanded: &quot; + lang.dump(l, 0));</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">loaded</span> <span class="o">=</span> <span class="nx">l</span><span class="p">;</span>

        <span class="p">},</span>


        <span class="cm">/**</span>
<span class="cm">         * Inspects the required modules list looking for additional</span>
<span class="cm">         * dependencies.  Expands the required list to include all</span>
<span class="cm">         * required modules.  Called by calculate()</span>
<span class="cm">         * @method _explode</span>
<span class="cm">         * @private</span>
<span class="cm">         */</span>
        <span class="nx">_explode</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>

            <span class="kd">var</span> <span class="nx">r</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">required</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">mod</span><span class="p">;</span>

            <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="k">in</span> <span class="nx">r</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">mod</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">mod</span><span class="p">)</span> <span class="p">{</span>

                        <span class="kd">var</span> <span class="nx">req</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">getRequires</span><span class="p">(</span><span class="nx">mod</span><span class="p">);</span>

                        <span class="k">if</span> <span class="p">(</span><span class="nx">req</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">YUI</span><span class="p">.</span><span class="nx">ObjectUtil</span><span class="p">.</span><span class="nx">appendArray</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">req</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">},</span>

        <span class="cm">/*</span>
<span class="cm">         * @method _skin</span>
<span class="cm">         * @private</span>
<span class="cm">         * @deprecated</span>
<span class="cm">         */</span>
        <span class="nx">_skin</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Returns the skin module name for the specified skin name.  If a</span>
<span class="cm">         * module name is supplied, the returned skin module name is</span>
<span class="cm">         * specific to the module passed in.</span>
<span class="cm">         * @method formatSkin</span>
<span class="cm">         * @param skin {string} the name of the skin</span>
<span class="cm">         * @param mod {string} optional: the name of a module to skin</span>
<span class="cm">         * @return {string} the full skin module name</span>
<span class="cm">         */</span>
        <span class="nx">formatSkin</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">skin</span><span class="p">,</span> <span class="nx">mod</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">s</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">SKIN_PREFIX</span> <span class="o">+</span> <span class="nx">skin</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">mod</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">s</span> <span class="o">=</span> <span class="nx">s</span> <span class="o">+</span> <span class="s2">&quot;-&quot;</span> <span class="o">+</span> <span class="nx">mod</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="k">return</span> <span class="nx">s</span><span class="p">;</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Reverses &lt;code&gt;formatSkin&lt;/code&gt;, providing the skin name and</span>
<span class="cm">         * module name if the string matches the pattern for skins.</span>
<span class="cm">         * @method parseSkin</span>
<span class="cm">         * @param mod {string} the module name to parse</span>
<span class="cm">         * @return {skin: string, module: string} the parsed skin name</span>
<span class="cm">         * and module name, or null if the supplied string does not match</span>
<span class="cm">         * the skin pattern</span>
<span class="cm">         */</span>
        <span class="nx">parseSkin</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">mod</span><span class="p">)</span> <span class="p">{</span>

            <span class="k">if</span> <span class="p">(</span><span class="nx">mod</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">SKIN_PREFIX</span><span class="p">)</span> <span class="o">===</span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">a</span> <span class="o">=</span> <span class="nx">mod</span><span class="p">.</span><span class="nx">split</span><span class="p">(</span><span class="s2">&quot;-&quot;</span><span class="p">);</span>
                <span class="k">return</span> <span class="p">{</span><span class="nx">skin</span><span class="o">:</span> <span class="nx">a</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="nx">module</span><span class="o">:</span> <span class="nx">a</span><span class="p">[</span><span class="mi">2</span><span class="p">]};</span>
            <span class="p">}</span>

            <span class="k">return</span> <span class="kc">null</span><span class="p">;</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Look for rollup packages to determine if all of the modules a</span>
<span class="cm">         * rollup supersedes are required.  If so, include the rollup to</span>
<span class="cm">         * help reduce the total number of connections required.  Called</span>
<span class="cm">         * by calculate()</span>
<span class="cm">         * @method _rollup</span>
<span class="cm">         * @private</span>
<span class="cm">         */</span>
        <span class="nx">_rollup</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">j</span><span class="p">,</span> <span class="nx">m</span><span class="p">,</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">rollups</span><span class="o">=</span><span class="p">{},</span> <span class="nx">r</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">required</span><span class="p">,</span> <span class="nx">roll</span><span class="p">,</span>
                <span class="nx">info</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">;</span>

            <span class="c1">// find and cache rollup modules</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">dirty</span> <span class="o">||</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">rollups</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="k">in</span> <span class="nx">info</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">info</span><span class="p">,</span> <span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                        <span class="nx">m</span> <span class="o">=</span> <span class="nx">info</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                        <span class="c1">//if (m &amp;&amp; m.rollup &amp;&amp; m.supersedes) {</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">m</span> <span class="o">&amp;&amp;</span> <span class="nx">m</span><span class="p">.</span><span class="nx">rollup</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">rollups</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="nx">m</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>

                <span class="k">this</span><span class="p">.</span><span class="nx">rollups</span> <span class="o">=</span> <span class="nx">rollups</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="c1">// make as many passes as needed to pick up rollup rollups</span>
            <span class="k">for</span> <span class="p">(;;)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">rolled</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>

                <span class="c1">// go through the rollup candidates</span>
                <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="k">in</span> <span class="nx">rollups</span><span class="p">)</span> <span class="p">{</span>

                    <span class="c1">// there can be only one</span>
                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">r</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">loaded</span><span class="p">[</span><span class="nx">i</span><span class="p">])</span> <span class="p">{</span>
                        <span class="nx">m</span> <span class="o">=</span><span class="nx">info</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span> <span class="nx">s</span> <span class="o">=</span> <span class="nx">m</span><span class="p">.</span><span class="nx">supersedes</span><span class="p">;</span> <span class="nx">roll</span><span class="o">=</span><span class="kc">false</span><span class="p">;</span>

                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">m</span><span class="p">.</span><span class="nx">rollup</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">continue</span><span class="p">;</span>
                        <span class="p">}</span>

                        <span class="kd">var</span> <span class="nx">skin</span> <span class="o">=</span> <span class="p">(</span><span class="nx">m</span><span class="p">.</span><span class="nx">ext</span><span class="p">)</span> <span class="o">?</span> <span class="kc">false</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">parseSkin</span><span class="p">(</span><span class="nx">i</span><span class="p">),</span> <span class="nx">c</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>

                        <span class="c1">// Y.log(&#39;skin? &#39; + i + &quot;: &quot; + skin);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">skin</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">for</span> <span class="p">(</span><span class="nx">j</span> <span class="k">in</span> <span class="nx">r</span><span class="p">)</span> <span class="p">{</span>
                                <span class="k">if</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">j</span><span class="p">))</span> <span class="p">{</span>
                                    <span class="k">if</span> <span class="p">(</span><span class="nx">i</span> <span class="o">!==</span> <span class="nx">j</span> <span class="o">&amp;&amp;</span> <span class="k">this</span><span class="p">.</span><span class="nx">parseSkin</span><span class="p">(</span><span class="nx">j</span><span class="p">))</span> <span class="p">{</span>
                                        <span class="nx">c</span><span class="o">++</span><span class="p">;</span>
                                        <span class="nx">roll</span> <span class="o">=</span> <span class="p">(</span><span class="nx">c</span> <span class="o">&gt;=</span> <span class="nx">m</span><span class="p">.</span><span class="nx">rollup</span><span class="p">);</span>
                                        <span class="k">if</span> <span class="p">(</span><span class="nx">roll</span><span class="p">)</span> <span class="p">{</span>
                                            <span class="c1">// Y.log(&quot;skin rollup &quot; + lang.dump(r));</span>
                                            <span class="k">break</span><span class="p">;</span>
                                        <span class="p">}</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                            <span class="p">}</span>

                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>

                            <span class="c1">// check the threshold</span>
                            <span class="k">for</span> <span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="nx">j</span><span class="o">&lt;</span><span class="nx">s</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span><span class="nx">j</span><span class="o">=</span><span class="nx">j</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>

                                <span class="c1">// if the superseded module is loaded, we can&#39;t load the rollup</span>
                                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">loaded</span><span class="p">[</span><span class="nx">s</span><span class="p">[</span><span class="nx">j</span><span class="p">]]</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="o">!</span><span class="nx">YUI</span><span class="p">.</span><span class="nx">dupsAllowed</span><span class="p">[</span><span class="nx">s</span><span class="p">[</span><span class="nx">j</span><span class="p">]]))</span> <span class="p">{</span>
                                    <span class="nx">roll</span> <span class="o">=</span> <span class="kc">false</span><span class="p">;</span>
                                    <span class="k">break</span><span class="p">;</span>
                                <span class="c1">// increment the counter if this module is required.  if we are</span>
                                <span class="c1">// beyond the rollup threshold, we will use the rollup module</span>
                                <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="nx">r</span><span class="p">[</span><span class="nx">s</span><span class="p">[</span><span class="nx">j</span><span class="p">]])</span> <span class="p">{</span>
                                    <span class="nx">c</span><span class="o">++</span><span class="p">;</span>
                                    <span class="nx">roll</span> <span class="o">=</span> <span class="p">(</span><span class="nx">c</span> <span class="o">&gt;=</span> <span class="nx">m</span><span class="p">.</span><span class="nx">rollup</span><span class="p">);</span>
                                    <span class="k">if</span> <span class="p">(</span><span class="nx">roll</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="c1">// Y.log(&quot;over thresh &quot; + c + &quot;, &quot; + lang.dump(r));</span>
                                        <span class="k">break</span><span class="p">;</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>

                        <span class="k">if</span> <span class="p">(</span><span class="nx">roll</span><span class="p">)</span> <span class="p">{</span>
                            <span class="c1">// Y.log(&quot;rollup: &quot; +  i + &quot;, &quot; + lang.dump(this, 1));</span>
                            <span class="c1">// add the rollup</span>
                            <span class="nx">r</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                            <span class="nx">rolled</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

                            <span class="c1">// expand the rollup&#39;s dependencies</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">getRequires</span><span class="p">(</span><span class="nx">m</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>

                <span class="c1">// if we made it here w/o rolling up something, we are done</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">rolled</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Remove superceded modules and loaded modules.  Called by</span>
<span class="cm">         * calculate() after we have the mega list of all dependencies</span>
<span class="cm">         * @method _reduce</span>
<span class="cm">         * @private</span>
<span class="cm">         */</span>
        <span class="nx">_reduce</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>

            <span class="kd">var</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">j</span><span class="p">,</span> <span class="nx">s</span><span class="p">,</span> <span class="nx">m</span><span class="p">,</span> <span class="nx">r</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">required</span><span class="p">;</span>
            <span class="k">for</span> <span class="p">(</span><span class="nx">i</span> <span class="k">in</span> <span class="nx">r</span><span class="p">)</span> <span class="p">{</span>

                <span class="c1">// remove if already loaded</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">i</span> <span class="k">in</span> <span class="k">this</span><span class="p">.</span><span class="nx">loaded</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">delete</span> <span class="nx">r</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>

                <span class="c1">// remove anything this module supersedes</span>
                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>

                    <span class="kd">var</span> <span class="nx">skinDef</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">parseSkin</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>

                    <span class="k">if</span> <span class="p">(</span><span class="nx">skinDef</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">//YAHOO.log(&quot;skin found in reduce: &quot; + skinDef.skin + &quot;, &quot; + skinDef.module);</span>
                        <span class="c1">// the skin rollup will not have a module name</span>
                        <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">skinDef</span><span class="p">.</span><span class="nx">module</span><span class="p">)</span> <span class="p">{</span>
                            <span class="kd">var</span> <span class="nx">skin_pre</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">SKIN_PREFIX</span> <span class="o">+</span> <span class="nx">skinDef</span><span class="p">.</span><span class="nx">skin</span><span class="p">;</span>
                            <span class="c1">//YAHOO.log(&quot;skin_pre: &quot; + skin_pre);</span>
                            <span class="k">for</span> <span class="p">(</span><span class="nx">j</span> <span class="k">in</span> <span class="nx">r</span><span class="p">)</span> <span class="p">{</span>

                                <span class="k">if</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="nx">r</span><span class="p">,</span> <span class="nx">j</span><span class="p">))</span> <span class="p">{</span>
                                    <span class="nx">m</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">[</span><span class="nx">j</span><span class="p">];</span>
                                    <span class="kd">var</span> <span class="nx">ext</span> <span class="o">=</span> <span class="nx">m</span> <span class="o">&amp;&amp;</span> <span class="nx">m</span><span class="p">.</span><span class="nx">ext</span><span class="p">;</span>
                                    <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">ext</span> <span class="o">&amp;&amp;</span> <span class="nx">j</span> <span class="o">!==</span> <span class="nx">i</span> <span class="o">&amp;&amp;</span> <span class="nx">j</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">skin_pre</span><span class="p">)</span> <span class="o">&gt;</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                                        <span class="c1">// Y.log (&quot;removing component skin: &quot; + j);</span>
                                        <span class="k">delete</span> <span class="nx">r</span><span class="p">[</span><span class="nx">j</span><span class="p">];</span>
                                    <span class="p">}</span>
                                <span class="p">}</span>
                            <span class="p">}</span>
                        <span class="p">}</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>

                         <span class="nx">m</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                         <span class="nx">s</span> <span class="o">=</span> <span class="nx">m</span> <span class="o">&amp;&amp;</span> <span class="nx">m</span><span class="p">.</span><span class="nx">supersedes</span><span class="p">;</span>
                         <span class="k">if</span> <span class="p">(</span><span class="nx">s</span><span class="p">)</span> <span class="p">{</span>
                             <span class="k">for</span> <span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">s</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">j</span><span class="o">=</span><span class="nx">j</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                                 <span class="k">if</span> <span class="p">(</span><span class="nx">s</span><span class="p">[</span><span class="nx">j</span><span class="p">]</span> <span class="k">in</span> <span class="nx">r</span><span class="p">)</span> <span class="p">{</span>
                                     <span class="k">delete</span> <span class="nx">r</span><span class="p">[</span><span class="nx">s</span><span class="p">[</span><span class="nx">j</span><span class="p">]];</span>
                                 <span class="p">}</span>
                             <span class="p">}</span>
                         <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>
            <span class="p">}</span>
        <span class="p">},</span>

        <span class="nx">_onFailure</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">msg</span><span class="p">)</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Failure&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;loader&#39;</span><span class="p">);</span>

            <span class="kd">var</span> <span class="nx">f</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">onFailure</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">f</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">f</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">scope</span><span class="p">,</span> <span class="p">{</span>
                    <span class="nx">msg</span><span class="o">:</span> <span class="s1">&#39;failure: &#39;</span> <span class="o">+</span> <span class="nx">msg</span><span class="p">,</span>
                    <span class="nx">data</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">data</span><span class="p">,</span>
                    <span class="nx">success</span><span class="o">:</span> <span class="kc">false</span>
                <span class="p">});</span>
            <span class="p">}</span>
        <span class="p">},</span>

        <span class="nx">_onTimeout</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Timeout&#39;</span><span class="p">,</span> <span class="s1">&#39;info&#39;</span><span class="p">,</span> <span class="s1">&#39;loader&#39;</span><span class="p">);</span>
            <span class="kd">var</span> <span class="nx">f</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">onTimeout</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">f</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">f</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">scope</span><span class="p">,</span> <span class="p">{</span>
                    <span class="nx">msg</span><span class="o">:</span> <span class="s1">&#39;timeout&#39;</span><span class="p">,</span>
                    <span class="nx">data</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">data</span><span class="p">,</span>
                    <span class="nx">success</span><span class="o">:</span> <span class="kc">false</span>
                <span class="p">});</span>
            <span class="p">}</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Sorts the dependency tree.  The last step of calculate()</span>
<span class="cm">         * @method _sort</span>
<span class="cm">         * @private</span>
<span class="cm">         */</span>
        <span class="nx">_sort</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="c1">// create an indexed list</span>
            <span class="kd">var</span> <span class="nx">s</span><span class="o">=</span><span class="p">[],</span> <span class="nx">info</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">,</span> <span class="nx">loaded</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">loaded</span><span class="p">,</span>
                <span class="nx">checkOptional</span><span class="o">=!</span><span class="k">this</span><span class="p">.</span><span class="nx">loadOptional</span><span class="p">,</span> <span class="nx">me</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>

            <span class="c1">// returns true if b is not loaded, and is required</span>
            <span class="c1">// directly or by means of modules it supersedes.</span>
            <span class="kd">var</span> <span class="nx">requires</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">aa</span><span class="p">,</span> <span class="nx">bb</span><span class="p">)</span> <span class="p">{</span>

                <span class="kd">var</span> <span class="nx">mm</span><span class="o">=</span><span class="nx">info</span><span class="p">[</span><span class="nx">aa</span><span class="p">];</span>

                <span class="k">if</span> <span class="p">(</span><span class="nx">loaded</span><span class="p">[</span><span class="nx">bb</span><span class="p">]</span> <span class="o">||</span> <span class="o">!</span><span class="nx">mm</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="kd">var</span> <span class="nx">ii</span><span class="p">,</span>
                    <span class="nx">rr</span> <span class="o">=</span> <span class="nx">mm</span><span class="p">.</span><span class="nx">expanded</span><span class="p">,</span>
                    <span class="nx">after</span> <span class="o">=</span> <span class="nx">mm</span><span class="p">.</span><span class="nx">after</span><span class="p">,</span>
                    <span class="nx">other</span> <span class="o">=</span> <span class="nx">info</span><span class="p">[</span><span class="nx">bb</span><span class="p">],</span>
                    <span class="nx">optional</span> <span class="o">=</span> <span class="nx">mm</span><span class="p">.</span><span class="nx">optional</span><span class="p">;</span>


                <span class="c1">// check if this module requires the other directly</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">rr</span> <span class="o">&amp;&amp;</span> <span class="nx">YUI</span><span class="p">.</span><span class="nx">ArrayUtil</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">rr</span><span class="p">,</span> <span class="nx">bb</span><span class="p">)</span> <span class="o">&gt;</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="c1">// check if this module should be sorted after the other</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">after</span> <span class="o">&amp;&amp;</span> <span class="nx">YUI</span><span class="p">.</span><span class="nx">ArrayUtil</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">after</span><span class="p">,</span> <span class="nx">bb</span><span class="p">)</span> <span class="o">&gt;</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="c1">// if loadOptional is not specified, optional dependencies still</span>
                <span class="c1">// must be sorted correctly when present.</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">checkOptional</span> <span class="o">&amp;&amp;</span> <span class="nx">optional</span> <span class="o">&amp;&amp;</span> <span class="nx">YUI</span><span class="p">.</span><span class="nx">ArrayUtil</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="nx">optional</span><span class="p">,</span> <span class="nx">bb</span><span class="p">)</span> <span class="o">&gt;</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="c1">// check if this module requires one the other supersedes</span>
                <span class="kd">var</span> <span class="nx">ss</span><span class="o">=</span><span class="nx">info</span><span class="p">[</span><span class="nx">bb</span><span class="p">]</span> <span class="o">&amp;&amp;</span> <span class="nx">info</span><span class="p">[</span><span class="nx">bb</span><span class="p">].</span><span class="nx">supersedes</span><span class="p">;</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">ss</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">for</span> <span class="p">(</span><span class="nx">ii</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">ii</span><span class="o">&lt;</span><span class="nx">ss</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span> <span class="nx">ii</span><span class="o">=</span><span class="nx">ii</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">requires</span><span class="p">(</span><span class="nx">aa</span><span class="p">,</span> <span class="nx">ss</span><span class="p">[</span><span class="nx">ii</span><span class="p">]))</span> <span class="p">{</span>
                            <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">}</span>

                <span class="c1">// external css files should be sorted below yui css</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">mm</span><span class="p">.</span><span class="nx">ext</span> <span class="o">&amp;&amp;</span> <span class="nx">mm</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;css&#39;</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">other</span><span class="p">.</span><span class="nx">ext</span> <span class="o">&amp;&amp;</span> <span class="nx">other</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;css&#39;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="k">return</span> <span class="kc">false</span><span class="p">;</span>
            <span class="p">};</span>

            <span class="c1">// get the required items out of the obj into an array so we</span>
            <span class="c1">// can sort</span>
            <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">i</span> <span class="k">in</span> <span class="k">this</span><span class="p">.</span><span class="nx">required</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">lang</span><span class="p">.</span><span class="nx">hasOwnProperty</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">required</span><span class="p">,</span> <span class="nx">i</span><span class="p">))</span> <span class="p">{</span>
                    <span class="nx">s</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">i</span><span class="p">);</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="c1">// pointer to the first unsorted item</span>
            <span class="kd">var</span> <span class="nx">p</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>

            <span class="c1">// keep going until we make a pass without moving anything</span>
            <span class="k">for</span> <span class="p">(;;)</span> <span class="p">{</span>

                <span class="kd">var</span> <span class="nx">l</span><span class="o">=</span><span class="nx">s</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span> <span class="nx">a</span><span class="p">,</span> <span class="nx">b</span><span class="p">,</span> <span class="nx">j</span><span class="p">,</span> <span class="nx">k</span><span class="p">,</span> <span class="nx">moved</span><span class="o">=</span><span class="kc">false</span><span class="p">;</span>

                <span class="c1">// start the loop after items that are already sorted</span>
                <span class="k">for</span> <span class="p">(</span><span class="nx">j</span><span class="o">=</span><span class="nx">p</span><span class="p">;</span> <span class="nx">j</span><span class="o">&lt;</span><span class="nx">l</span><span class="p">;</span> <span class="nx">j</span><span class="o">=</span><span class="nx">j</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>

                    <span class="c1">// check the next module on the list to see if its</span>
                    <span class="c1">// dependencies have been met</span>
                    <span class="nx">a</span> <span class="o">=</span> <span class="nx">s</span><span class="p">[</span><span class="nx">j</span><span class="p">];</span>

                    <span class="c1">// check everything below current item and move if we</span>
                    <span class="c1">// find a requirement for the current item</span>
                    <span class="k">for</span> <span class="p">(</span><span class="nx">k</span><span class="o">=</span><span class="nx">j</span><span class="o">+</span><span class="mi">1</span><span class="p">;</span> <span class="nx">k</span><span class="o">&lt;</span><span class="nx">l</span><span class="p">;</span> <span class="nx">k</span><span class="o">=</span><span class="nx">k</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">requires</span><span class="p">(</span><span class="nx">a</span><span class="p">,</span> <span class="nx">s</span><span class="p">[</span><span class="nx">k</span><span class="p">]))</span> <span class="p">{</span>

                            <span class="c1">// extract the dependency so we can move it up</span>
                            <span class="nx">b</span> <span class="o">=</span> <span class="nx">s</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">k</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>

                            <span class="c1">// insert the dependency above the item that</span>
                            <span class="c1">// requires it</span>
                            <span class="nx">s</span><span class="p">.</span><span class="nx">splice</span><span class="p">(</span><span class="nx">j</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="nx">b</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>

                            <span class="nx">moved</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                            <span class="k">break</span><span class="p">;</span>
                        <span class="p">}</span>
                    <span class="p">}</span>

                    <span class="c1">// jump out of loop if we moved something</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">moved</span><span class="p">)</span> <span class="p">{</span>
                        <span class="k">break</span><span class="p">;</span>
                    <span class="c1">// this item is sorted, move our pointer and keep going</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">p</span> <span class="o">=</span> <span class="nx">p</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span>
                    <span class="p">}</span>
                <span class="p">}</span>

                <span class="c1">// when we make it here and moved is false, we are</span>
                <span class="c1">// finished sorting</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">moved</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">break</span><span class="p">;</span>
                <span class="p">}</span>

            <span class="p">}</span>

            <span class="k">this</span><span class="p">.</span><span class="nx">sorted</span> <span class="o">=</span> <span class="nx">s</span><span class="p">;</span>
        <span class="p">},</span>

        <span class="nx">toString</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">o</span> <span class="o">=</span> <span class="p">{</span>
                <span class="nx">type</span><span class="o">:</span> <span class="s2">&quot;YUILoader&quot;</span><span class="p">,</span>
                <span class="nx">base</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">base</span><span class="p">,</span>
                <span class="nx">filter</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">filter</span><span class="p">,</span>
                <span class="nx">required</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">required</span><span class="p">,</span>
                <span class="nx">loaded</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">loaded</span><span class="p">,</span>
                <span class="nx">inserted</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">inserted</span>
            <span class="p">};</span>

            <span class="nx">lang</span><span class="p">.</span><span class="nx">dump</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="mi">1</span><span class="p">);</span>
        <span class="p">},</span>

        <span class="nx">_combine</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>

                <span class="k">this</span><span class="p">.</span><span class="nx">_combining</span> <span class="o">=</span> <span class="p">[];</span>

                <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span>
                    <span class="nx">s</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">sorted</span><span class="p">,</span>
                    <span class="nx">len</span> <span class="o">=</span> <span class="nx">s</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
                    <span class="nx">js</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">comboBase</span><span class="p">,</span>
                    <span class="nx">css</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">comboBase</span><span class="p">,</span>
                    <span class="nx">target</span><span class="p">,</span>
                    <span class="nx">startLen</span> <span class="o">=</span> <span class="nx">js</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span>
                    <span class="nx">i</span><span class="p">,</span> <span class="nx">m</span><span class="p">,</span> <span class="nx">type</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">loadType</span><span class="p">;</span>

                <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;type &#39;</span> <span class="o">+</span> <span class="nx">type</span><span class="p">);</span>

                <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>

                    <span class="nx">m</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">[</span><span class="nx">s</span><span class="p">[</span><span class="nx">i</span><span class="p">]];</span>

                    <span class="k">if</span> <span class="p">(</span><span class="nx">m</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nx">m</span><span class="p">.</span><span class="nx">ext</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="o">!</span><span class="nx">type</span> <span class="o">||</span> <span class="nx">type</span> <span class="o">===</span> <span class="nx">m</span><span class="p">.</span><span class="nx">type</span><span class="p">))</span> <span class="p">{</span>

                        <span class="nx">target</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">root</span> <span class="o">+</span> <span class="nx">m</span><span class="p">.</span><span class="nx">path</span><span class="p">;</span>

                        <span class="c1">// if (i &lt; len-1) {</span>
                        <span class="nx">target</span> <span class="o">+=</span> <span class="s1">&#39;&amp;&#39;</span><span class="p">;</span>
                        <span class="c1">// }</span>

                        <span class="k">if</span> <span class="p">(</span><span class="nx">m</span><span class="p">.</span><span class="nx">type</span> <span class="o">==</span> <span class="s1">&#39;js&#39;</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">js</span> <span class="o">+=</span> <span class="nx">target</span><span class="p">;</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="nx">css</span> <span class="o">+=</span> <span class="nx">target</span><span class="p">;</span>
                        <span class="p">}</span>

                        <span class="c1">// YAHOO.log(target);</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_combining</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">s</span><span class="p">[</span><span class="nx">i</span><span class="p">]);</span>
                    <span class="p">}</span>
                <span class="p">}</span>

                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_combining</span><span class="p">.</span><span class="nx">length</span><span class="p">)</span> <span class="p">{</span>

<span class="nx">YAHOO</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="s1">&#39;Attempting to combine: &#39;</span> <span class="o">+</span> <span class="k">this</span><span class="p">.</span><span class="nx">_combining</span><span class="p">,</span> <span class="s2">&quot;info&quot;</span><span class="p">,</span> <span class="s2">&quot;loader&quot;</span><span class="p">);</span>

                    <span class="kd">var</span> <span class="nx">callback</span><span class="o">=</span><span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
                        <span class="c1">// YAHOO.log(&#39;Combo complete: &#39; + o.data, &quot;info&quot;, &quot;loader&quot;);</span>
                        <span class="c1">// this._combineComplete = true;</span>

                        <span class="kd">var</span> <span class="nx">c</span><span class="o">=</span><span class="k">this</span><span class="p">.</span><span class="nx">_combining</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">c</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">m</span><span class="p">;</span>
                        <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">inserted</span><span class="p">[</span><span class="nx">c</span><span class="p">[</span><span class="nx">i</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                        <span class="p">}</span>

                        <span class="k">this</span><span class="p">.</span><span class="nx">loadNext</span><span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">data</span><span class="p">);</span>
                    <span class="p">},</span>

                    <span class="nx">loadScript</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                        <span class="c1">// YAHOO.log(&#39;combining js: &#39; + js);</span>
                        <span class="k">if</span> <span class="p">(</span><span class="nx">js</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="nx">startLen</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">(</span><span class="nx">self</span><span class="p">.</span><span class="nx">_filter</span><span class="p">(</span><span class="nx">js</span><span class="p">),</span> <span class="p">{</span>
                                <span class="nx">data</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">_loading</span><span class="p">,</span>
                                <span class="nx">onSuccess</span><span class="o">:</span> <span class="nx">callback</span><span class="p">,</span>
                                <span class="nx">onFailure</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">_onFailure</span><span class="p">,</span>
                                <span class="nx">onTimeout</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">_onTimeout</span><span class="p">,</span>
                                <span class="nx">insertBefore</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">,</span>
                                <span class="nx">charset</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">charset</span><span class="p">,</span>
                                <span class="nx">timeout</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">timeout</span><span class="p">,</span>
                                <span class="nx">scope</span><span class="o">:</span> <span class="nx">self</span>
                            <span class="p">});</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="k">this</span><span class="p">.</span><span class="nx">loadNext</span><span class="p">();</span>
                        <span class="p">}</span>
                    <span class="p">};</span>

                    <span class="c1">// load the css first</span>
                    <span class="c1">// YAHOO.log(&#39;combining css: &#39; + css);</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">css</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="nx">startLen</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">css</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_filter</span><span class="p">(</span><span class="nx">css</span><span class="p">),</span> <span class="p">{</span>
                            <span class="nx">data</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_loading</span><span class="p">,</span>
                            <span class="nx">onSuccess</span><span class="o">:</span> <span class="nx">loadScript</span><span class="p">,</span>
                            <span class="nx">onFailure</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onFailure</span><span class="p">,</span>
                            <span class="nx">onTimeout</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTimeout</span><span class="p">,</span>
                            <span class="nx">insertBefore</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">,</span>
                            <span class="nx">charset</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">charset</span><span class="p">,</span>
                            <span class="nx">timeout</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">timeout</span><span class="p">,</span>
                            <span class="nx">scope</span><span class="o">:</span> <span class="nx">self</span>
                        <span class="p">});</span>
                    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                        <span class="nx">loadScript</span><span class="p">();</span>
                    <span class="p">}</span>

                    <span class="k">return</span><span class="p">;</span>

                <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                    <span class="c1">// this._combineComplete = true;</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">loadNext</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_loading</span><span class="p">);</span>
                <span class="p">}</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * inserts the requested modules and their dependencies.</span>
<span class="cm">         * &lt;code&gt;type&lt;/code&gt; can be &quot;js&quot; or &quot;css&quot;.  Both script and</span>
<span class="cm">         * css are inserted if type is not provided.</span>
<span class="cm">         * @method insert</span>
<span class="cm">         * @param o optional options object</span>
<span class="cm">         * @param type {string} the type of dependency to insert</span>
<span class="cm">         */</span>
        <span class="nx">insert</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">type</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// if (o) {</span>
            <span class="c1">//     Y.log(&quot;insert: &quot; + lang.dump(o, 1) + &quot;, &quot; + type);</span>
            <span class="c1">// } else {</span>
            <span class="c1">//     Y.log(&quot;insert: &quot; + this.toString() + &quot;, &quot; + type);</span>
            <span class="c1">// }</span>

            <span class="c1">// build the dependency list</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">calculate</span><span class="p">(</span><span class="nx">o</span><span class="p">);</span>


            <span class="c1">// set a flag to indicate the load has started</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_loading</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

            <span class="c1">// flag to indicate we are done with the combo service</span>
            <span class="c1">// and any additional files will need to be loaded</span>
            <span class="c1">// individually</span>
            <span class="c1">// this._combineComplete = false;</span>

            <span class="c1">// keep the loadType (js, css or undefined) cached</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">loadType</span> <span class="o">=</span> <span class="nx">type</span><span class="p">;</span>

            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">combine</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_combine</span><span class="p">();</span>
            <span class="p">}</span>

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">type</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// Y.log(&quot;trying to load css first&quot;);</span>
                <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_internalCallback</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                            <span class="nx">self</span><span class="p">.</span><span class="nx">_internalCallback</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                            <span class="nx">self</span><span class="p">.</span><span class="nx">insert</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="s2">&quot;js&quot;</span><span class="p">);</span>
                        <span class="p">};</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">insert</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="s2">&quot;css&quot;</span><span class="p">);</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="p">}</span>


            <span class="c1">// start the load</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">loadNext</span><span class="p">();</span>

        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Interns the script for the requested modules.  The callback is</span>
<span class="cm">         * provided a reference to the sandboxed YAHOO object.  This only</span>
<span class="cm">         * applies to the script: css can not be sandboxed; css will be</span>
<span class="cm">         * loaded into the page normally if specified.</span>
<span class="cm">         * @method sandbox</span>
<span class="cm">         * @param callback {Function} the callback to exectued when the load is</span>
<span class="cm">         *        complete.</span>
<span class="cm">         */</span>
        <span class="nx">sandbox</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">,</span> <span class="nx">type</span><span class="p">)</span> <span class="p">{</span>
            <span class="c1">// if (o) {</span>
                <span class="c1">// YAHOO.log(&quot;sandbox: &quot; + lang.dump(o, 1) + &quot;, &quot; + type);</span>
            <span class="c1">// } else {</span>
                <span class="c1">// YAHOO.log(&quot;sandbox: &quot; + this.toString() + &quot;, &quot; + type);</span>
            <span class="c1">// }</span>

            <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span>
                <span class="nx">success</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>

                    <span class="kd">var</span> <span class="nx">idx</span><span class="o">=</span><span class="nx">o</span><span class="p">.</span><span class="nx">argument</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="nx">name</span><span class="o">=</span><span class="nx">o</span><span class="p">.</span><span class="nx">argument</span><span class="p">[</span><span class="mi">2</span><span class="p">];</span>

                    <span class="c1">// store the response in the position it was requested</span>
                    <span class="nx">self</span><span class="p">.</span><span class="nx">_scriptText</span><span class="p">[</span><span class="nx">idx</span><span class="p">]</span> <span class="o">=</span> <span class="nx">o</span><span class="p">.</span><span class="nx">responseText</span><span class="p">;</span>

                    <span class="c1">// YAHOO.log(&quot;received: &quot; + o.responseText.substr(0, 100) + &quot;, &quot; + idx);</span>

                    <span class="k">if</span> <span class="p">(</span><span class="nx">self</span><span class="p">.</span><span class="nx">onProgress</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">self</span><span class="p">.</span><span class="nx">onProgress</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">.</span><span class="nx">scope</span><span class="p">,</span> <span class="p">{</span>
                                    <span class="nx">name</span><span class="o">:</span> <span class="nx">name</span><span class="p">,</span>
                                    <span class="nx">scriptText</span><span class="o">:</span> <span class="nx">o</span><span class="p">.</span><span class="nx">responseText</span><span class="p">,</span>
                                    <span class="nx">xhrResponse</span><span class="o">:</span> <span class="nx">o</span><span class="p">,</span>
                                    <span class="nx">data</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">data</span>
                                <span class="p">});</span>
                    <span class="p">}</span>

                    <span class="c1">// only generate the sandbox once everything is loaded</span>
                    <span class="nx">self</span><span class="p">.</span><span class="nx">_loadCount</span><span class="o">++</span><span class="p">;</span>

                    <span class="k">if</span> <span class="p">(</span><span class="nx">self</span><span class="p">.</span><span class="nx">_loadCount</span> <span class="o">&gt;=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">_stopCount</span><span class="p">)</span> <span class="p">{</span>

                        <span class="c1">// the variable to find</span>
                        <span class="kd">var</span> <span class="nx">v</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">varName</span> <span class="o">||</span> <span class="s2">&quot;YAHOO&quot;</span><span class="p">;</span>

                        <span class="c1">// wrap the contents of the requested modules in an anonymous function</span>
                        <span class="kd">var</span> <span class="nx">t</span> <span class="o">=</span> <span class="s2">&quot;(function() {\n&quot;</span><span class="p">;</span>

                        <span class="c1">// return the locally scoped reference.</span>
                        <span class="kd">var</span> <span class="nx">b</span> <span class="o">=</span> <span class="s2">&quot;\nreturn &quot;</span> <span class="o">+</span> <span class="nx">v</span> <span class="o">+</span> <span class="s2">&quot;;\n})();&quot;</span><span class="p">;</span>

                        <span class="kd">var</span> <span class="nx">ref</span> <span class="o">=</span> <span class="nb">eval</span><span class="p">(</span><span class="nx">t</span> <span class="o">+</span> <span class="nx">self</span><span class="p">.</span><span class="nx">_scriptText</span><span class="p">.</span><span class="nx">join</span><span class="p">(</span><span class="s2">&quot;\n&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="nx">b</span><span class="p">);</span>

                        <span class="nx">self</span><span class="p">.</span><span class="nx">_pushEvents</span><span class="p">(</span><span class="nx">ref</span><span class="p">);</span>

                        <span class="k">if</span> <span class="p">(</span><span class="nx">ref</span><span class="p">)</span> <span class="p">{</span>
                            <span class="nx">self</span><span class="p">.</span><span class="nx">onSuccess</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">.</span><span class="nx">scope</span><span class="p">,</span> <span class="p">{</span>
                                    <span class="nx">reference</span><span class="o">:</span> <span class="nx">ref</span><span class="p">,</span>
                                    <span class="nx">data</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">data</span>
                                <span class="p">});</span>
                        <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
                            <span class="nx">self</span><span class="p">.</span><span class="nx">_onFailure</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">.</span><span class="nx">varName</span> <span class="o">+</span> <span class="s2">&quot; reference failure&quot;</span><span class="p">);</span>
                        <span class="p">}</span>
                    <span class="p">}</span>
                <span class="p">},</span>

                <span class="nx">failure</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">self</span><span class="p">.</span><span class="nx">onFailure</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="nx">self</span><span class="p">.</span><span class="nx">scope</span><span class="p">,</span> <span class="p">{</span>
                            <span class="nx">msg</span><span class="o">:</span> <span class="s2">&quot;XHR failure&quot;</span><span class="p">,</span>
                            <span class="nx">xhrResponse</span><span class="o">:</span> <span class="nx">o</span><span class="p">,</span>
                            <span class="nx">data</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">data</span>
                        <span class="p">});</span>
                <span class="p">};</span>

            <span class="nx">self</span><span class="p">.</span><span class="nx">_config</span><span class="p">(</span><span class="nx">o</span><span class="p">);</span>

            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">self</span><span class="p">.</span><span class="nx">onSuccess</span><span class="p">)</span> <span class="p">{</span>
<span class="k">throw</span> <span class="k">new</span> <span class="nb">Error</span><span class="p">(</span><span class="s2">&quot;You must supply an onSuccess handler for your sandbox&quot;</span><span class="p">);</span>
            <span class="p">}</span>

            <span class="nx">self</span><span class="p">.</span><span class="nx">_sandbox</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>


            <span class="c1">// take care of any css first (this can&#39;t be sandboxed)</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">type</span> <span class="o">||</span> <span class="nx">type</span> <span class="o">!==</span> <span class="s2">&quot;js&quot;</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">self</span><span class="p">.</span><span class="nx">_internalCallback</span> <span class="o">=</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                            <span class="nx">self</span><span class="p">.</span><span class="nx">_internalCallback</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                            <span class="nx">self</span><span class="p">.</span><span class="nx">sandbox</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="s2">&quot;js&quot;</span><span class="p">);</span>
                        <span class="p">};</span>
                <span class="nx">self</span><span class="p">.</span><span class="nx">insert</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="s2">&quot;css&quot;</span><span class="p">);</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="c1">// get the connection manager if not on the page</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">util</span><span class="p">.</span><span class="nx">Connect</span><span class="p">)</span> <span class="p">{</span>
                <span class="c1">// get a new loader instance to load connection.</span>
                <span class="kd">var</span> <span class="nx">ld</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">YAHOO</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">YUILoader</span><span class="p">();</span>
                <span class="nx">ld</span><span class="p">.</span><span class="nx">insert</span><span class="p">({</span>
                    <span class="nx">base</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">base</span><span class="p">,</span>
                    <span class="nx">filter</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">filter</span><span class="p">,</span>
                    <span class="nx">require</span><span class="o">:</span> <span class="s2">&quot;connection&quot;</span><span class="p">,</span>
                    <span class="nx">insertBefore</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">,</span>
                    <span class="nx">charset</span><span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">charset</span><span class="p">,</span>
                    <span class="nx">onSuccess</span><span class="o">:</span> <span class="kd">function</span><span class="p">()</span> <span class="p">{</span>
                        <span class="nx">self</span><span class="p">.</span><span class="nx">sandbox</span><span class="p">(</span><span class="kc">null</span><span class="p">,</span> <span class="s2">&quot;js&quot;</span><span class="p">);</span>
                    <span class="p">},</span>
                    <span class="nx">scope</span><span class="o">:</span> <span class="nx">self</span>
                <span class="p">},</span> <span class="s2">&quot;js&quot;</span><span class="p">);</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="nx">self</span><span class="p">.</span><span class="nx">_scriptText</span> <span class="o">=</span> <span class="p">[];</span>
            <span class="nx">self</span><span class="p">.</span><span class="nx">_loadCount</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
            <span class="nx">self</span><span class="p">.</span><span class="nx">_stopCount</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">sorted</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span>
            <span class="nx">self</span><span class="p">.</span><span class="nx">_xhr</span> <span class="o">=</span> <span class="p">[];</span>

            <span class="nx">self</span><span class="p">.</span><span class="nx">calculate</span><span class="p">();</span>

            <span class="kd">var</span> <span class="nx">s</span><span class="o">=</span><span class="nx">self</span><span class="p">.</span><span class="nx">sorted</span><span class="p">,</span> <span class="nx">l</span><span class="o">=</span><span class="nx">s</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">m</span><span class="p">,</span> <span class="nx">url</span><span class="p">;</span>

            <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">l</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">m</span> <span class="o">=</span> <span class="nx">self</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">[</span><span class="nx">s</span><span class="p">[</span><span class="nx">i</span><span class="p">]];</span>

                <span class="c1">// undefined modules cause a failure</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">m</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">self</span><span class="p">.</span><span class="nx">_onFailure</span><span class="p">(</span><span class="s2">&quot;undefined module &quot;</span> <span class="o">+</span> <span class="nx">m</span><span class="p">);</span>
                    <span class="k">for</span> <span class="p">(</span><span class="kd">var</span> <span class="nx">j</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span><span class="nx">j</span><span class="o">&lt;</span><span class="nx">self</span><span class="p">.</span><span class="nx">_xhr</span><span class="p">.</span><span class="nx">length</span><span class="p">;</span><span class="nx">j</span><span class="o">=</span><span class="nx">j</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>
                        <span class="nx">self</span><span class="p">.</span><span class="nx">_xhr</span><span class="p">[</span><span class="nx">j</span><span class="p">].</span><span class="nx">abort</span><span class="p">();</span>
                    <span class="p">}</span>
                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="c1">// css files should be done</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">m</span><span class="p">.</span><span class="nx">type</span> <span class="o">!==</span> <span class="s2">&quot;js&quot;</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">self</span><span class="p">.</span><span class="nx">_loadCount</span><span class="o">++</span><span class="p">;</span>
                    <span class="k">continue</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="nx">url</span> <span class="o">=</span> <span class="nx">m</span><span class="p">.</span><span class="nx">fullpath</span><span class="p">;</span>
                <span class="nx">url</span> <span class="o">=</span> <span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="o">?</span> <span class="nx">self</span><span class="p">.</span><span class="nx">_filter</span><span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="o">:</span> <span class="nx">self</span><span class="p">.</span><span class="nx">_url</span><span class="p">(</span><span class="nx">m</span><span class="p">.</span><span class="nx">path</span><span class="p">);</span>

                <span class="c1">// YAHOO.log(&quot;xhr request: &quot; + url + &quot;, &quot; + i);</span>

                <span class="kd">var</span> <span class="nx">xhrData</span> <span class="o">=</span> <span class="p">{</span>
                    <span class="nx">success</span><span class="o">:</span> <span class="nx">success</span><span class="p">,</span>
                    <span class="nx">failure</span><span class="o">:</span> <span class="nx">failure</span><span class="p">,</span>
                    <span class="nx">scope</span><span class="o">:</span> <span class="nx">self</span><span class="p">,</span>
                    <span class="c1">// [module index, module name, sandbox name]</span>
                    <span class="nx">argument</span><span class="o">:</span> <span class="p">[</span><span class="nx">i</span><span class="p">,</span> <span class="nx">url</span><span class="p">,</span> <span class="nx">s</span><span class="p">[</span><span class="nx">i</span><span class="p">]]</span>
                <span class="p">};</span>

                <span class="nx">self</span><span class="p">.</span><span class="nx">_xhr</span><span class="p">.</span><span class="nx">push</span><span class="p">(</span><span class="nx">util</span><span class="p">.</span><span class="nx">Connect</span><span class="p">.</span><span class="nx">asyncRequest</span><span class="p">(</span><span class="s1">&#39;GET&#39;</span><span class="p">,</span> <span class="nx">url</span><span class="p">,</span> <span class="nx">xhrData</span><span class="p">));</span>
            <span class="p">}</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Executed every time a module is loaded, and if we are in a load</span>
<span class="cm">         * cycle, we attempt to load the next script.  Public so that it</span>
<span class="cm">         * is possible to call this if using a method other than</span>
<span class="cm">         * YAHOO.register to determine when scripts are fully loaded</span>
<span class="cm">         * @method loadNext</span>
<span class="cm">         * @param mname {string} optional the name of the module that has</span>
<span class="cm">         * been loaded (which is usually why it is time to load the next</span>
<span class="cm">         * one)</span>
<span class="cm">         */</span>
        <span class="nx">loadNext</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">mname</span><span class="p">)</span> <span class="p">{</span>

            <span class="c1">// It is possible that this function is executed due to something</span>
            <span class="c1">// else one the page loading a YUI module.  Only react when we</span>
            <span class="c1">// are actively loading something</span>
            <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">_loading</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">return</span><span class="p">;</span>
            <span class="p">}</span>

            <span class="kd">var</span> <span class="nx">self</span> <span class="o">=</span> <span class="k">this</span><span class="p">,</span>
                <span class="nx">donext</span> <span class="o">=</span> <span class="kd">function</span><span class="p">(</span><span class="nx">o</span><span class="p">)</span> <span class="p">{</span>
                    <span class="nx">self</span><span class="p">.</span><span class="nx">loadNext</span><span class="p">(</span><span class="nx">o</span><span class="p">.</span><span class="nx">data</span><span class="p">);</span>
                <span class="p">},</span> <span class="nx">successfn</span><span class="p">,</span> <span class="nx">s</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">sorted</span><span class="p">,</span> <span class="nx">len</span><span class="o">=</span><span class="nx">s</span><span class="p">.</span><span class="nx">length</span><span class="p">,</span> <span class="nx">i</span><span class="p">,</span> <span class="nx">fn</span><span class="p">,</span> <span class="nx">m</span><span class="p">,</span> <span class="nx">url</span><span class="p">;</span>


            <span class="k">if</span> <span class="p">(</span><span class="nx">mname</span><span class="p">)</span> <span class="p">{</span>

                <span class="c1">// if the module that was just loaded isn&#39;t what we were expecting,</span>
                <span class="c1">// continue to wait</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">mname</span> <span class="o">!==</span> <span class="k">this</span><span class="p">.</span><span class="nx">_loading</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="c1">// YAHOO.log(&quot;loadNext executing, just loaded &quot; + mname);</span>

                <span class="c1">// The global handler that is called when each module is loaded</span>
                <span class="c1">// will pass that module name to this function.  Storing this</span>
                <span class="c1">// data to avoid loading the same module multiple times</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">inserted</span><span class="p">[</span><span class="nx">mname</span><span class="p">]</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>

                <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">onProgress</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">onProgress</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">scope</span><span class="p">,</span> <span class="p">{</span>
                            <span class="nx">name</span><span class="o">:</span> <span class="nx">mname</span><span class="p">,</span>
                            <span class="nx">data</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">data</span>
                        <span class="p">});</span>
                <span class="p">}</span>
                <span class="c1">//var o = this.getProvides(mname);</span>
                <span class="c1">//this.inserted = lang.merge(this.inserted, o);</span>
            <span class="p">}</span>



            <span class="k">for</span> <span class="p">(</span><span class="nx">i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span> <span class="nx">i</span><span class="o">&lt;</span><span class="nx">len</span><span class="p">;</span> <span class="nx">i</span><span class="o">=</span><span class="nx">i</span><span class="o">+</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span>

                <span class="c1">// This.inserted keeps track of what the loader has loaded</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">s</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="k">in</span> <span class="k">this</span><span class="p">.</span><span class="nx">inserted</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// YAHOO.log(s[i] + &quot; alread loaded &quot;);</span>
                    <span class="k">continue</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="c1">// Because rollups will cause multiple load notifications</span>
                <span class="c1">// from YAHOO, loadNext may be called multiple times for</span>
                <span class="c1">// the same module when loading a rollup.  We can safely</span>
                <span class="c1">// skip the subsequent requests</span>
                <span class="k">if</span> <span class="p">(</span><span class="nx">s</span><span class="p">[</span><span class="nx">i</span><span class="p">]</span> <span class="o">===</span> <span class="k">this</span><span class="p">.</span><span class="nx">_loading</span><span class="p">)</span> <span class="p">{</span>
                    <span class="c1">// YAHOO.log(&quot;still loading &quot; + s[i] + &quot;, waiting&quot;);</span>
                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="c1">// log(&quot;inserting &quot; + s[i]);</span>
                <span class="nx">m</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">moduleInfo</span><span class="p">[</span><span class="nx">s</span><span class="p">[</span><span class="nx">i</span><span class="p">]];</span>

                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">m</span><span class="p">)</span> <span class="p">{</span>
                    <span class="k">this</span><span class="p">.</span><span class="nx">onFailure</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">scope</span><span class="p">,</span> <span class="p">{</span>
                            <span class="nx">msg</span><span class="o">:</span> <span class="s2">&quot;undefined module &quot;</span> <span class="o">+</span> <span class="nx">m</span><span class="p">,</span>
                            <span class="nx">data</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">data</span>
                        <span class="p">});</span>
                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>

                <span class="c1">// The load type is stored to offer the possibility to load</span>
                <span class="c1">// the css separately from the script.</span>
                <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">this</span><span class="p">.</span><span class="nx">loadType</span> <span class="o">||</span> <span class="k">this</span><span class="p">.</span><span class="nx">loadType</span> <span class="o">===</span> <span class="nx">m</span><span class="p">.</span><span class="nx">type</span><span class="p">)</span> <span class="p">{</span>

                    <span class="nx">successfn</span> <span class="o">=</span> <span class="nx">donext</span><span class="p">;</span>

                    <span class="k">this</span><span class="p">.</span><span class="nx">_loading</span> <span class="o">=</span> <span class="nx">s</span><span class="p">[</span><span class="nx">i</span><span class="p">];</span>
                    <span class="c1">//YAHOO.log(&quot;attempting to load &quot; + s[i] + &quot;, &quot; + this.base);</span>

                    <span class="nx">fn</span> <span class="o">=</span> <span class="p">(</span><span class="nx">m</span><span class="p">.</span><span class="nx">type</span> <span class="o">===</span> <span class="s2">&quot;css&quot;</span><span class="p">)</span> <span class="o">?</span> <span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">css</span> <span class="o">:</span> <span class="nx">util</span><span class="p">.</span><span class="nx">Get</span><span class="p">.</span><span class="nx">script</span><span class="p">;</span>
                    <span class="nx">url</span> <span class="o">=</span> <span class="nx">m</span><span class="p">.</span><span class="nx">fullpath</span><span class="p">;</span>
                    <span class="nx">url</span> <span class="o">=</span> <span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="o">?</span> <span class="k">this</span><span class="p">.</span><span class="nx">_filter</span><span class="p">(</span><span class="nx">url</span><span class="p">)</span> <span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_url</span><span class="p">(</span><span class="nx">m</span><span class="p">.</span><span class="nx">path</span><span class="p">);</span>

                    <span class="c1">// safari 2.x or lower, script, and part of YUI</span>
                    <span class="k">if</span> <span class="p">(</span><span class="nx">env</span><span class="p">.</span><span class="nx">ua</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">&amp;&amp;</span> <span class="nx">env</span><span class="p">.</span><span class="nx">ua</span><span class="p">.</span><span class="nx">webkit</span> <span class="o">&lt;</span> <span class="mi">420</span> <span class="o">&amp;&amp;</span> <span class="nx">m</span><span class="p">.</span><span class="nx">type</span> <span class="o">===</span> <span class="s2">&quot;js&quot;</span> <span class="o">&amp;&amp;</span>
                          <span class="o">!</span><span class="nx">m</span><span class="p">.</span><span class="nx">varName</span><span class="p">)</span> <span class="p">{</span>
                          <span class="c1">//YUI.info.moduleInfo[s[i]]) {</span>
                          <span class="c1">//YAHOO.log(&quot;using YAHOO env &quot; + s[i] + &quot;, &quot; + m.varName);</span>
                        <span class="nx">successfn</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                        <span class="k">this</span><span class="p">.</span><span class="nx">_useYahooListener</span> <span class="o">=</span> <span class="kc">true</span><span class="p">;</span>
                    <span class="p">}</span>

                    <span class="nx">fn</span><span class="p">(</span><span class="nx">url</span><span class="p">,</span> <span class="p">{</span>
                        <span class="nx">data</span><span class="o">:</span> <span class="nx">s</span><span class="p">[</span><span class="nx">i</span><span class="p">],</span>
                        <span class="nx">onSuccess</span><span class="o">:</span> <span class="nx">successfn</span><span class="p">,</span>
                        <span class="nx">onFailure</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onFailure</span><span class="p">,</span>
                        <span class="nx">onTimeout</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">_onTimeout</span><span class="p">,</span>
                        <span class="nx">insertBefore</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">insertBefore</span><span class="p">,</span>
                        <span class="nx">charset</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">charset</span><span class="p">,</span>
                        <span class="nx">timeout</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">timeout</span><span class="p">,</span>
                        <span class="nx">varName</span><span class="o">:</span> <span class="nx">m</span><span class="p">.</span><span class="nx">varName</span><span class="p">,</span>
                        <span class="nx">scope</span><span class="o">:</span> <span class="nx">self</span>
                    <span class="p">});</span>

                    <span class="k">return</span><span class="p">;</span>
                <span class="p">}</span>
            <span class="p">}</span>

            <span class="c1">// we are finished</span>
            <span class="k">this</span><span class="p">.</span><span class="nx">_loading</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>

            <span class="c1">// internal callback for loading css first</span>
            <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">_internalCallback</span><span class="p">)</span> <span class="p">{</span>
                <span class="kd">var</span> <span class="nx">f</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">_internalCallback</span><span class="p">;</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_internalCallback</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
                <span class="nx">f</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">);</span>
            <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">onSuccess</span><span class="p">)</span> <span class="p">{</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">_pushEvents</span><span class="p">();</span>
                <span class="k">this</span><span class="p">.</span><span class="nx">onSuccess</span><span class="p">.</span><span class="nx">call</span><span class="p">(</span><span class="k">this</span><span class="p">.</span><span class="nx">scope</span><span class="p">,</span> <span class="p">{</span>
                        <span class="nx">data</span><span class="o">:</span> <span class="k">this</span><span class="p">.</span><span class="nx">data</span>
                    <span class="p">});</span>
            <span class="p">}</span>

        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * In IE, the onAvailable/onDOMReady events need help when Event is</span>
<span class="cm">         * loaded dynamically</span>
<span class="cm">         * @method _pushEvents</span>
<span class="cm">         * @param {Function} optional function reference</span>
<span class="cm">         * @private</span>
<span class="cm">         */</span>
        <span class="nx">_pushEvents</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">ref</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">r</span> <span class="o">=</span> <span class="nx">ref</span> <span class="o">||</span> <span class="nx">YAHOO</span><span class="p">;</span>
            <span class="k">if</span> <span class="p">(</span><span class="nx">r</span><span class="p">.</span><span class="nx">util</span> <span class="o">&amp;&amp;</span> <span class="nx">r</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">)</span> <span class="p">{</span>
                <span class="nx">r</span><span class="p">.</span><span class="nx">util</span><span class="p">.</span><span class="nx">Event</span><span class="p">.</span><span class="nx">_load</span><span class="p">();</span>
            <span class="p">}</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Applies filter</span>
<span class="cm">         * method _filter</span>
<span class="cm">         * @return {string} the filtered string</span>
<span class="cm">         * @private</span>
<span class="cm">         */</span>
        <span class="nx">_filter</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">str</span><span class="p">)</span> <span class="p">{</span>
            <span class="kd">var</span> <span class="nx">f</span> <span class="o">=</span> <span class="k">this</span><span class="p">.</span><span class="nx">filter</span><span class="p">;</span>
            <span class="k">return</span> <span class="p">(</span><span class="nx">f</span><span class="p">)</span> <span class="o">?</span>  <span class="nx">str</span><span class="p">.</span><span class="nx">replace</span><span class="p">(</span><span class="k">new</span> <span class="nb">RegExp</span><span class="p">(</span><span class="nx">f</span><span class="p">.</span><span class="nx">searchExp</span><span class="p">,</span> <span class="s1">&#39;g&#39;</span><span class="p">),</span> <span class="nx">f</span><span class="p">.</span><span class="nx">replaceStr</span><span class="p">)</span> <span class="o">:</span> <span class="nx">str</span><span class="p">;</span>
        <span class="p">},</span>

        <span class="cm">/**</span>
<span class="cm">         * Generates the full url for a module</span>
<span class="cm">         * method _url</span>
<span class="cm">         * @param path {string} the path fragment</span>
<span class="cm">         * @return {string} the full url</span>
<span class="cm">         * @private</span>
<span class="cm">         */</span>
        <span class="nx">_url</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">path</span><span class="p">)</span> <span class="p">{</span>
            <span class="k">return</span> <span class="k">this</span><span class="p">.</span><span class="nx">_filter</span><span class="p">((</span><span class="k">this</span><span class="p">.</span><span class="nx">base</span> <span class="o">||</span> <span class="s2">&quot;&quot;</span><span class="p">)</span> <span class="o">+</span> <span class="nx">path</span><span class="p">);</span>
        <span class="p">}</span>

    <span class="p">};</span>

<span class="p">})();</span>
</pre></div>

                    </div>
			</div>
		</div>
		<div class="yui-b">
            <div class="nav">

                    <div id="moduleList" class="module">
                        <h4>Modules</h4>
                        <ul class="content">
                                <li class=""><a href="module_animation.html" title="animation">animation</a></li>
                                <li class=""><a href="module_autocomplete.html" title="autocomplete">autocomplete</a></li>
                                <li class=""><a href="module_button.html" title="button">button</a></li>
                                <li class=""><a href="module_calendar.html" title="calendar">calendar</a></li>
                                <li class=""><a href="module_carousel.html" title="carousel">carousel</a></li>
                                <li class=""><a href="module_charts.html" title="charts">charts</a></li>
                                <li class=""><a href="module_colorpicker.html" title="colorpicker">colorpicker</a></li>
                                <li class=""><a href="module_connection.html" title="connection">connection</a></li>
                                <li class=""><a href="module_container.html" title="container">container</a></li>
                                <li class=""><a href="module_cookie.html" title="cookie">cookie</a></li>
                                <li class=""><a href="module_datasource.html" title="datasource">datasource</a></li>
                                <li class=""><a href="module_datatable.html" title="datatable">datatable</a></li>
                                <li class=""><a href="module_datemath.html" title="datemath">datemath</a></li>
                                <li class=""><a href="module_dom.html" title="dom">dom</a></li>
                                <li class=""><a href="module_dragdrop.html" title="dragdrop">dragdrop</a></li>
                                <li class=""><a href="module_editor.html" title="editor">editor</a></li>
                                <li class=""><a href="module_element.html" title="element">element</a></li>
                                <li class=""><a href="module_element-delegate.html" title="element-delegate">element-delegate</a></li>
                                <li class=""><a href="module_event.html" title="event">event</a></li>
                                <li class=""><a href="module_event-delegate.html" title="event-delegate">event-delegate</a></li>
                                <li class=""><a href="module_event-mouseenter.html" title="event-mouseenter">event-mouseenter</a></li>
                                <li class=""><a href="module_event-simulate.html" title="event-simulate">event-simulate</a></li>
                                <li class=""><a href="module_get.html" title="get">get</a></li>
                                <li class=""><a href="module_history.html" title="history">history</a></li>
                                <li class=""><a href="module_imagecropper.html" title="imagecropper">imagecropper</a></li>
                                <li class=""><a href="module_imageloader.html" title="imageloader">imageloader</a></li>
                                <li class=""><a href="module_json.html" title="json">json</a></li>
                                <li class=""><a href="module_layout.html" title="layout">layout</a></li>
                                <li class=""><a href="module_logger.html" title="logger">logger</a></li>
                                <li class=""><a href="module_menu.html" title="menu">menu</a></li>
                                <li class=""><a href="module_paginator.html" title="paginator">paginator</a></li>
                                <li class=""><a href="module_profiler.html" title="profiler">profiler</a></li>
                                <li class=""><a href="module_profilerviewer.html" title="profilerviewer">profilerviewer</a></li>
                                <li class=""><a href="module_progressbar.html" title="progressbar">progressbar</a></li>
                                <li class=""><a href="module_resize.html" title="resize">resize</a></li>
                                <li class=""><a href="module_selector.html" title="selector">selector</a></li>
                                <li class=""><a href="module_slider.html" title="slider">slider</a></li>
                                <li class=""><a href="module_storage.html" title="Storage">Storage</a></li>
                                <li class=""><a href="module_stylesheet.html" title="stylesheet">stylesheet</a></li>
                                <li class=""><a href="module_swf.html" title="swf">swf</a></li>
                                <li class=""><a href="module_swfdetect.html" title="swfdetect">swfdetect</a></li>
                                <li class=""><a href="module_swfstore.html" title="swfstore">swfstore</a></li>
                                <li class=""><a href="module_tabview.html" title="tabview">tabview</a></li>
                                <li class=""><a href="module_treeview.html" title="treeview">treeview</a></li>
                                <li class=""><a href="module_uploader.html" title="uploader">uploader</a></li>
                                <li class=""><a href="module_yahoo.html" title="yahoo">yahoo</a></li>
                                <li class="selected"><a href="module_yuiloader.html" title="yuiloader">yuiloader</a></li>
                                <li class=""><a href="module_yuitest.html" title="yuitest">yuitest</a></li>
                        </ul>
                    </div>

                    <div id="classList" class="module">
                        <h4>Classes</h4>
                        <ul class="content">
                                <li class=""><a href="YAHOO.util.YUILoader.html" title="YAHOO.util.YUILoader">YAHOO.util.YUILoader</a></li>
                        </ul>
                    </div>

                    <div id="fileList" class="module">
                        <h4>Files</h4>
                        <ul class="content">        
                                <li class="selected"><a href="yuiloader.js.html" title="yuiloader.js">yuiloader.js</a></li>
                        </ul>
                    </div>





            </div>
		</div>
	</div>
	<div id="ft">
        <hr />
        Copyright &copy; 2011 Yahoo! Inc. All rights reserved.
	</div>
</div>
<script type="text/javascript">

    var ALL_YUI_PROPS = [{"access": "", "host": "YAHOO.util.YUILoader", "name": "addModule", "url": "YAHOO.util.YUILoader.html#method_addModule", "type": "method"}, {"access": "private", "host": "YAHOO.util.YUILoader", "name": "_addSkin", "url": "YAHOO.util.YUILoader.html#method__addSkin", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "allowRollup", "url": "YAHOO.util.YUILoader.html#property_allowRollup", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "base", "url": "YAHOO.util.YUILoader.html#property_base", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "calculate", "url": "YAHOO.util.YUILoader.html#method_calculate", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "charset", "url": "YAHOO.util.YUILoader.html#property_charset", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "combine", "url": "YAHOO.util.YUILoader.html#property_combine", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "comboBase", "url": "YAHOO.util.YUILoader.html#property_comboBase", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "data", "url": "YAHOO.util.YUILoader.html#property_data", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "dirty", "url": "YAHOO.util.YUILoader.html#property_dirty", "type": "property"}, {"access": "private", "host": "YAHOO.util.YUILoader", "name": "_explode", "url": "YAHOO.util.YUILoader.html#method__explode", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "filter", "url": "YAHOO.util.YUILoader.html#property_filter", "type": "property"}, {"access": "private", "host": "YAHOO.util.YUILoader", "name": "_filter", "url": "YAHOO.util.YUILoader.html#method__filter", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "force", "url": "YAHOO.util.YUILoader.html#property_force", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "formatSkin", "url": "YAHOO.util.YUILoader.html#method_formatSkin", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "getProvides", "url": "YAHOO.util.YUILoader.html#method_getProvides", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "getRequires", "url": "YAHOO.util.YUILoader.html#method_getRequires", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "ignore", "url": "YAHOO.util.YUILoader.html#property_ignore", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "insert", "url": "YAHOO.util.YUILoader.html#method_insert", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "insertBefore", "url": "YAHOO.util.YUILoader.html#property_insertBefore", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "inserted", "url": "YAHOO.util.YUILoader.html#property_inserted", "type": "property"}, {"access": "private", "host": "YAHOO.util.YUILoader", "name": "_internalCallback", "url": "YAHOO.util.YUILoader.html#property__internalCallback", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "loaded", "url": "YAHOO.util.YUILoader.html#property_loaded", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "loadNext", "url": "YAHOO.util.YUILoader.html#method_loadNext", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "loadOptional", "url": "YAHOO.util.YUILoader.html#property_loadOptional", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "moduleInfo", "url": "YAHOO.util.YUILoader.html#property_moduleInfo", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "onFailure", "url": "YAHOO.util.YUILoader.html#method_onFailure", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "onProgress", "url": "YAHOO.util.YUILoader.html#method_onProgress", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "onSuccess", "url": "YAHOO.util.YUILoader.html#method_onSuccess", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "onTimeout", "url": "YAHOO.util.YUILoader.html#method_onTimeout", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "parseSkin", "url": "YAHOO.util.YUILoader.html#method_parseSkin", "type": "method"}, {"access": "private", "host": "YAHOO.util.YUILoader", "name": "_pushEvents", "url": "YAHOO.util.YUILoader.html#method__pushEvents", "type": "method"}, {"access": "private", "host": "YAHOO.util.YUILoader", "name": "_reduce", "url": "YAHOO.util.YUILoader.html#method__reduce", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "require", "url": "YAHOO.util.YUILoader.html#method_require", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "required", "url": "YAHOO.util.YUILoader.html#property_required", "type": "property"}, {"access": "private", "host": "YAHOO.util.YUILoader", "name": "_rollup", "url": "YAHOO.util.YUILoader.html#method__rollup", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "rollups", "url": "YAHOO.util.YUILoader.html#property_rollups", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "root", "url": "YAHOO.util.YUILoader.html#property_root", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "sandbox", "url": "YAHOO.util.YUILoader.html#method_sandbox", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "scope", "url": "YAHOO.util.YUILoader.html#property_scope", "type": "property"}, {"access": "private", "host": "YAHOO.util.YUILoader", "name": "_setup", "url": "YAHOO.util.YUILoader.html#method__setup", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "skin", "url": "YAHOO.util.YUILoader.html#property_skin", "type": "property"}, {"access": "private", "host": "YAHOO.util.YUILoader", "name": "_sort", "url": "YAHOO.util.YUILoader.html#method__sort", "type": "method"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "sorted", "url": "YAHOO.util.YUILoader.html#property_sorted", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "timeout", "url": "YAHOO.util.YUILoader.html#property_timeout", "type": "property"}, {"access": "private", "host": "YAHOO.util.YUILoader", "name": "_url", "url": "YAHOO.util.YUILoader.html#method__url", "type": "method"}, {"access": "private", "host": "YAHOO.util.YUILoader", "name": "_useYahooListener", "url": "YAHOO.util.YUILoader.html#property__useYahooListener", "type": "property"}, {"access": "", "host": "YAHOO.util.YUILoader", "name": "varName", "url": "YAHOO.util.YUILoader.html#property_varName", "type": "property"}];
</script>
</body>
</html>
